Developers

Letting Your AI Agent Set Up and Inspect a Series over MCP

Published

Configuring a five-step series by hand means five subjects, five bodies, five delays and a handful of record options, typed into an editor and checked by eye. An AI agent connected over MCP can do the typing, read it all back, and answer the question you’ll actually have a week later: “Why hasn’t Jo had step 3 yet?”

This article shows how an agent sets up and inspects a series in Follow-up Emails, a premium add-on, using Super Speedy Emails’ own abilities plus the one ability the add-on adds. Connecting the agent is covered in Using AI to Manage Your Emails (MCP).

Available since Super Speedy Emails 1.38.0. Follow-up Emails needs Super Speedy Emails 1.38.1 or later.

The abilities involved

AbilityWhat it doesSends anything?
super-speedy-emails/list-support-rulesLists records, and the registered types with their options (max_stages, stage_fields, and record fields as settings)No
super-speedy-emails/draft-support-ruleCreates a record as a draftNo
super-speedy-emails/update-support-ruleEdits a record and keeps its draft, active or paused statusNo, but editing an active record needs the send capability
sse-follow-up/describe-seriesShows a series’ steps and settings and, for one email address, where that person isNo, read-only

The add-on deliberately adds no “create series” ability. Super Speedy Emails’ own support-rule abilities validate any type’s declared fields, so a second way to write records would only be a second set of rules to keep in step.

Step 1: let the agent discover the type

An agent shouldn’t guess field names. list-support-rules reports each registered type with its options, so the agent learns that follow_up_series takes any number of steps from 1 (stages 5, max_stages -1, no maximum), that each step has a timing select (after for “not sooner than”, the default, or exact for “exactly on”) and a delay_days number with defaults 1, 2, 3, 4, 5 (under stage_fields), and that the record takes anchor, min_gap_days, include_bundle_owners and one_per_day_global (under settings).

Two details of that report: the record’s own fields are listed as settings, the same key the draft takes them in, even though the type declares them in PHP as admin_fields; and a select field’s options are the bare values the ability accepts, without the labels the editor shows.

That’s the same declaration the wp-admin editor draws from. See Adding Your Own Settings to Super Speedy Emails for how a type declares them.

Step 2: draft the record

Each step is { subject, body, settings }, with the per-step options in settings. The record’s options go in the top-level settings. A shortened example, with two of the five steps:

{
  "name": "Performance Analysis Pro onboarding",
  "type": "follow_up_series",
  "product_ids": [1694147],
  "settings": {
    "anchor": "first",
    "min_gap_days": 1,
    "include_bundle_owners": false,
    "one_per_day_global": true
  },
  "stages": [
    { "subject": "Your first Performance Analysis Pro run",
      "body": "Hi,\n\nPerformance Analysis Pro installed its profiler when you activated it...",
      "settings": { "timing": "after", "delay_days": 1 } },
    { "subject": "Which plugin is actually slowing your site down?",
      "body": "Hi,\n\nPlugin Impact Analysis measures what each plugin costs...",
      "settings": { "timing": "after", "delay_days": 2 } }
  ]
}

What the engine does with it:

  • It’s always a draft. draft-support-rule forces status “draft” and returns the new id and an edit URL. A person activates it in wp-admin. The agent can draft, but can’t authorise its own sends.
  • Undeclared keys are dropped, and an invalid value falls back to the declared default, for the record and for each step.
  • Always pass type. Name the registered type key on every draft-support-rule call, taken from the types list in list-support-rules. Don’t rely on a default: the changelog type belongs to a separate companion plugin and is not registered on most sites, and a record whose type isn’t registered never sends.
  • The step count is checked. A type with a positive max_stages takes 1 to max_stages steps, a type with max_stages -1 takes 1 or more, and a fixed-count type (max_stages 0) takes exactly its stages count. A list outside that is refused with sse_stage_count, saying how many the type takes and how many were given. follow_up_series takes 1 or more.
  • Copy in the steps is enough. The record’s own subject and body can be left empty; stage 1 is used where the engine needs record-level copy.
Common mistake

Leaving {first_name} in the copy without checking your data. An owner with no recorded first name gets “Hi ,” from a bare placeholder. The Performance Analysis series opens every step with “Hi,” for that reason.

Step 3: edit it

update-support-rule takes the record id and any of the same fields. When you change steps, send the whole stages list: it’s stored as the record’s step sequence. Editing a draft or paused record needs only the manage capability. Editing an active record needs sse_send_emails as well, because the next scheduled run sends whatever the edit leaves.

Step 4: ask where someone is

sse-follow-up/describe-series takes a record_id and, optionally, an email. Without the email it returns the record (status, products, step count, next run time in UTC), its settings, the send mode and each step’s subject, day, timing and a one-line summary (“Step 3: exactly day 30”, “Step 1: day 1 or later”). With an email it adds, per product:

  • whether they own it, and whether directly
  • the purchase the series counts from, and days since
  • which steps were sent and when
  • which exactly-on steps were missed, each with the code exact_day_missed, the site-local date it was due and a sentence saying it is never sent
  • the next step, its day and timing (with the date it is due for an exactly-on step), and whether it’s due now
  • the earliest time it can be due, and the run expected to send it
  • not_due_because: every reason it isn’t due, each with a code and a sentence

The reasons are the useful bit. They’re produced by the same function the daily run uses to decide, so the explanation can’t drift from the behaviour. The codes you’ll normally see are too_soon_after_purchase, exact_day_not_yet, min_gap, already_sent_today, follow_up_already_today, bundle_owner_excluded, not_owner and series_complete. min_gap and follow_up_already_today never hold back an exactly-on step, which ignores both rules. A test checks that “due now” agrees with what the next run really sends.

Sent steps are counted in the current send mode, the same as the daily run. In log-only mode the answer describes the rehearsal track, which is what you want while rehearsing and a surprise if you forget which mode you’re in. The response includes send_mode so the agent can say which.

A safe working pattern

  1. Connect the agent without send access at first. It can list, draft, update drafts and describe, and every send operation is refused.
  2. Have it draft the series and read it back with list-support-rules.
  3. Rehearse in log-only mode (switching mode is a send-tier ability, so do it yourself in wp-admin or give that access deliberately). Rehearsals count separately and never use up real steps.
  4. Ask it to describe the series for two or three real customers: a new buyer, a long-time owner, someone with a bundle.
  5. Activate it yourself in wp-admin.

There’s also a send-support-email-run ability that fans out an active record immediately, with confirm=true required and marked irreversible. A follow-up series doesn’t need it: the daily run sends whatever is due. Leave it alone unless you know why you want it.

Prompt to give your AI

Using the Super Speedy Emails MCP abilities, call list-support-rules and read the
follow_up_series type's stage_fields and settings. Draft a follow-up series
for product <id> with draft-support-rule, passing type follow_up_series: these
<N> steps (subjects and bodies below), timing after, delay_days <1,2,3...>, anchor first,
min_gap_days 1, include_bundle_owners false, one_per_day_global true. Do not use {first_name}. Read the record back, then call
sse-follow-up/describe-series for <email> and explain which step they would get
next and why. Do not activate anything or change the send mode.

Further reading

Written for Super Speedy Emails 1.38.2.

Comments