marginal recommend_next examples for AI agents
The recommend_next tool is where marginal closes the loop on subject line testing — it reads completed experiment data and tells your agent what to try next. Below are concrete examples of how recommend_next behaves and how to wire it into an agent workflow.
What recommend_next actually does
recommend_next is one of four tools exposed by marginal, the hosted email MCP server (generate_variants, launch_test, get_results, recommend_next). After a subject line A/B test finishes, calling recommend_next analyzes within-test lift metrics — opens and clicks across variants — and returns a suggested direction for the next experiment.
Instead of an agent guessing a follow-up subject line from scratch, recommend_next grounds the suggestion in what already won. The output is meant to be fed straight back into generate_variants and launch_test to keep an iterative loop running.
- Input: a finished test identifier from launch_test / get_results
- Output: a recommended next angle plus reasoning based on observed lift
- Pairs naturally with generate_variants to draft the next round
- Runs against the endpoint at https://marginal.sh/mcp with your Bearer key
A typical agent loop using recommend_next
Most AI agent email marketing flows follow the same shape. The agent generates a handful of subject lines, launches a split test, waits for engagement data, then asks recommend_next where to go. These marginal recommend_next examples show that loop in plain terms.
- Step 1 — generate_variants: produce 4 candidate subject lines for a campaign
- Step 2 — launch_test: start a subject line A/B test with managed sends
- Step 3 — get_results: pull open/click rates and within-test lift once data lands
- Step 4 — recommend_next: surface the winning theme and a sharper follow-up
- Step 5 — repeat: feed the recommendation back into generate_variants
Example prompts that trigger recommend_next
Because marginal is exposed over MCP, you do not call recommend_next directly — you ask your agent in natural language and it selects the tool. These example prompts work in Claude Desktop, Cursor, Claude Code, Windsurf, Cline, Continue, Zed, and OpenAI Codex.
Keep prompts tied to a specific test so the agent has data to reason over. Vague prompts often get a clarifying question back instead of a recommendation.
- "My last subject line test finished — what should I test next?"
- "Use the results from the welcome-email experiment to recommend a follow-up subject line."
- "Which variant won and what angle should the next A/B test explore?"
- "Recommend the next experiment based on click lift, not just opens."
Getting set up to try these examples
To run these recommend_next examples yourself, connect marginal as an MCP server in your client of choice and authenticate with a Bearer API key (the marg_live_ format). The free tier includes 100 experiments per month, which is plenty to run several full generate → launch → recommend loops.
Full tool schemas and connection steps live in the docs at https://marginal.sh/docs/, and the MCP endpoint is https://marginal.sh/mcp. There's nothing to self-host — marginal is fully hosted.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key (marg_live_...)
- Free tier: 100 experiments/month
- Docs: https://marginal.sh/docs/
Get started with marginal
marginal is a hosted email marketing MCP server at marginal.sh. Sign up free, create an API key, and connect https://marginal.sh/mcp from Cursor, Codex, or Claude Desktop.
- 100 experiments/month on the free tier
- Four MCP tools: generate_variants, launch_test, get_results, recommend_next
- Listed in the MCP Registry as sh.marginal/mcp