← All guides marginal.sh

Function Calling Email Sends

Updated June 2026 · Hosted email MCP server

When an AI agent can call functions, sending email stops being a manual handoff and becomes another tool in the loop. marginal exposes email sends, A/B tests, and results as MCP tools your model can call directly — so an agent can draft variants, launch a test, and read lift metrics without leaving the conversation.

What function calling email sends actually means

Modern LLMs decide when to invoke a tool and with what arguments — that's function calling. The Model Context Protocol standardizes how those tools are described and reached, so any compatible client can discover them. marginal is a hosted email MCP server that publishes the send and test functions an agent needs.

Instead of writing glue code around an ESP, you point your agent at https://marginal.sh/mcp and let it call functions like a developer would call an SDK method — but driven by the model's reasoning about your campaign goal.

A typical agent loop

Because each step is a callable function, the agent can chain them. A subject line A/B test goes from idea to live send in a single back-and-forth, and the model uses returned metrics to choose what to do next rather than guessing.

Why a hosted MCP server fits AI agent email marketing

marginal runs the send infrastructure and tracking for you — there is no self-hosted MCP server to operate and no provisioning of mail pipelines on your side. You authenticate with a Bearer API key (marg_live_...) and the tools are immediately available to your agent.

That keeps AI agent email marketing reproducible: the same function calls behave the same way across runs, and tracking is consistent so the lift numbers an agent reads are trustworthy.

Getting started

Connect any MCP-capable client to the marginal endpoint, add your key, and prompt the agent with a campaign goal. From there function calling email sends are just part of the model's plan — it generates variants, launches the test, and reports results.

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