Anthropic tool use for email campaigns
Anthropic's tool use lets Claude call structured functions instead of guessing. Point it at marginal's email MCP server and your agent can write subject lines, launch an A/B test, and report which variant won — all without leaving the conversation.
How Anthropic tool use maps to email campaigns
With Anthropic tool use, Claude decides when to call a tool and supplies the arguments. marginal exposes the campaign primitives as MCP tools, so the model has a clear, typed contract for each step of an email workflow rather than free-form text it has to parse.
That structure is what makes AI agent email marketing reliable. Instead of asking the model to 'send an email' and hoping, you give it discrete actions it can chain: draft, test, measure, decide.
- generate_variants — produce candidate subject lines or copy
- launch_test — start a managed send with a subject line A/B test
- get_results — pull open/click and within-test lift metrics
- recommend_next — get the suggested winning variant or follow-up
Running a subject line A/B test through the agent
A typical loop starts with the model calling generate_variants to draft several subject lines for the same campaign goal. It then passes those into launch_test, which handles the managed send and splits the audience for you.
Once recipients engage, get_results returns open and click tracking plus the lift each variant earned against the control. The agent reads those numbers and can call recommend_next to decide what to send to the remaining audience — closing the loop without a human copying metrics between dashboards.
Connecting marginal as an email MCP server
marginal is a hosted email MCP server, so there's nothing to deploy. Connect any Anthropic-compatible client — Claude Desktop, Claude Code, Cursor, Windsurf, Cline, Continue, Codex, or Zed — to the endpoint at https://marginal.sh/mcp and authenticate with a Bearer API key (marg_live_...).
Because the tools are registered under sh.marginal/mcp, Claude discovers them automatically and can invoke Anthropic tool use against your email campaigns the moment the server is reachable.
- Endpoint: https://marginal.sh/mcp
- Auth: Bearer API key beginning with marg_live_
- Free tier: 100 experiments per month
- Docs and setup: https://marginal.sh/docs/
Why structured tools beat prompt-only sends
Asking a model to manage email purely through prose invites hallucinated stats and inconsistent formatting. Tool use forces every send and measurement through a real API, so the lift numbers your agent reports are actual results from marginal — not estimates.
The payoff is a repeatable pattern: the model proposes variants, marginal runs the subject line A/B test and tracks engagement, and the agent acts on measured outcomes. That's what turns Anthropic tool use into a dependable engine for email campaigns.
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