← All guides marginal.sh

marginal recommend_next examples for AI agents

Updated June 2026 · Hosted email MCP server

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.

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.

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.

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.

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.

Documentation · Sign up · FAQ