The marginal get_results JSON schema
When your AI agent calls get_results on marginal, it gets back a structured JSON payload summarizing how each subject line variant performed. This guide walks through that schema field by field so you can parse it confidently in any agent workflow.
What get_results returns
get_results is the marginal MCP tool that reports on a running or completed subject line A/B test. After you call launch_test, your agent polls or fetches get_results to read open and click metrics for each variant, plus within-test lift comparisons.
The response is plain JSON, so any MCP client — Cursor, Claude Code, Windsurf, Cline, Continue, or Zed — can consume it without custom parsing. The marginal get_results JSON schema is designed to be predictable and flat enough for AI agent email marketing logic to act on directly.
- Test-level identifiers so the agent knows which experiment it queried
- Per-variant subject line text and send counts
- Open and click metrics with tracked totals
- Lift figures comparing each variant against the control
Key fields to parse
While you should always treat the live docs as authoritative, the core shape of a get_results response groups data at two levels: the overall test and the individual variants. Agents typically iterate over the variants array to compare performance.
- test_id / status — which subject line A/B test this is and whether it is still running or finished
- variants[] — an array, one entry per subject line generated by generate_variants
- variants[].subject — the subject line text that was sent
- variants[].opens / clicks — tracked engagement counts and rates
- variants[].lift — within-test lift relative to the control variant
Using the schema in an agent loop
A common pattern is to chain get_results into recommend_next. The agent reads the JSON, checks whether the test has gathered enough signal, and either keeps waiting or asks marginal for a recommendation on the winning subject line.
Because the schema exposes raw counts alongside computed lift, your agent can apply its own confidence thresholds before declaring a winner — useful when you want stricter logic than a single lift number.
- Poll get_results until status indicates the test is complete
- Sort variants by open or click rate to surface the leader
- Pass results to recommend_next for a managed next-step suggestion
- Log the JSON for auditing your AI agent email marketing decisions
Connecting and reading the docs
marginal is a hosted email MCP server, so there is nothing to self-host. Point your client at https://marginal.sh/mcp, authenticate with a Bearer API key (marg_live_...), and the get_results tool becomes available alongside generate_variants, launch_test, and recommend_next.
The free tier covers 100 experiments per month, enough to validate your parsing logic against real data. For the canonical field list and example payloads, see the documentation at 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