Skip to main content
Glama

Add an email rule

add_email_rule

When something happens on one of the seller's checkouts, add the buyer to a tag or sequence (or automation, publication or group) in their connected email tool. when: sale (someone buys the checkout), order_bump (they add the order bump in the cart), upsell (they take the one-click upsell after paying), refund, subscription_cancelled, or checkout_abandoned (they typed their email on the checkout but hadn't paid wait_hours later; runs once per person and checkout, never for anyone who bought by then, never in test mode or on the seller's free trial, and only for emails typed after the rule was made). For example "order bump buyers → sequence X, upsell buyers → sequence Y, every sale → sequence Z" is three calls. With several order bumps or upsells, pass offer to pick one (its id from get_product, or its headline). Call list_email_options first for the exact tag and sequence names. Joining a sequence can start sending the buyer emails, so confirm the plan with the seller first. Applies straight away, also on a live checkout; the seller can pause or remove it under Automations, or with remove_email_rule.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "product": "<product>",
      "when": "<when>",
      "add": "<add>"
    },
    "name": "add_email_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
addYesThe tag, sequence, automation, publication or group, by its name or id from list_email_options.
kindNoOnly needed when a tag and a sequence share a name.
whenYes
offerNoOnly for order_bump or upsell: which one, by id or headline. Omit for any.
accountNoOnly to work in a client's account: its id from list_accounts. Leave it out for your own account.
productYesThe checkout's id or slug.
emailToolNoOnly needed with more than one email tool connected: its id or type (e.g. kit).
wait_hoursNoOnly for checkout_abandoned: how many hours after they typed their email, if they still haven't paid. Default 24.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations cover only the safety profile (not read-only, not open-world, not destructive); the description goes well beyond them by disclosing that joining a sequence can start sending buyer emails, that the rule applies immediately even on a live checkout, and the checkout_abandoned constraints (once per person/checkout, never in test mode or on free trial, only emails typed after rule creation). That is unusually rich side-effect disclosure, but there is no detail on error behavior, quota, or what the response contains, so it stops short of a 5 against the lower annotation bar.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, and nearly every clause (event definitions, constraints, call-ordering) is load-bearing. The long parenthetical covering checkout_abandoned is dense and slightly run-on, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter mutation tool with no output schema, the description covers triggers, defaults, prerequisites, multi-call composition, side effects, and the removal path, which is everything an agent needs to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 88%, so the schema carries most definitions; the description still adds value by explaining that `offer` selects among several bumps/upsells and by illustrating how `when`/`add` pair up across separate calls. It reinforces but does not substantially reinterpret the remaining parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (add an email rule) and spells out the trigger-and-action model: when a checkout event happens, add the buyer to a tag/sequence/etc. in the connected email tool. It is clearly distinguishable from remove_email_rule, which it names as the undo path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Enumerates every accepted `when` event, tells the agent to call list_email_options first for exact names and get_product for offer ids, and shows the multi-call pattern when several triggers map to different sequences. It also gives an explicit caution (confirm with the seller before joining a sequence) and names the alternatives for pausing/removing under Automations or remove_email_rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.