MCP Tool Design for an Agent That Sends Receipts and Newsletters Through One Authenticated Caller
Two named MCP tools keep receipts and newsletters safely apart.

A unified transactional and marketing email API for AI applications should provide one authenticated caller without reducing receipts and newsletters to one undifferentiated send operation. The reliable MCP design exposes two named tools, each with its own schema, validation hooks, idempotency controls, and sending domain.
Why a single authenticated MCP caller cannot treat transactional and marketing email as the same operation
An agent has just sent a purchase receipt and is now asked to dispatch this week's newsletter. The agent's obligations have changed while its credentials remain the same. The receipt follows a user action and is expected immediately, while the newsletter reaches an opted-in audience through a scheduled broadcast. Their failures run in opposite directions. A missing receipt creates silence where a user expects confirmation, while a faulty broadcast creates noise across many recipients.
That asymmetry extends to compliance and delivery. Transactional mail is exempt from opt-out requirements under U.S. CAN-SPAM, though requirements vary under GDPR and CASL, while newsletter sending requires consent, unsubscribe handling, and suppression enforcement. The sending entity remains responsible whether a human or an agent dispatches the message. Authentication does not resolve that distinction. Nor can it stop a spike in broadcast complaints from harming the reputation that receipts depend on when both modes use the same sending domain.
What MCP actually gives an agent that a raw API call does not
MCP exposes named tools through JSON-RPC 2.0, with JSON Schema definitions and structured errors. The agent constructs a call from typed parameters. The schema becomes an enforceable contract. That contract gives the server a place to reject invalid input before sending, instead of relying on the model to remember every condition while selecting recipients or generating content.
The 2026-07-28 MCP specification makes the protocol core stateless, with self-describing requests and no session handshake. State needed across calls must therefore appear as explicit arguments or server-minted handles. The compliance mode of a call cannot depend on the call before it. The specification also puts Mcp-Method on every request and requires Mcp-Name for tools/call, resources/read, and prompts/get, allowing gateways to route and authorize those operations without parsing the body.
Cache hints and deterministic ordering also allow clients to cache tool catalogs and keep upstream prompt caches stable across reconnects. Discovery need not introduce a shifting contract. REST remains sufficient when send parameters are known in advance and a developer could write the call directly. When recipient selection, content, or escalation depends on model reasoning at runtime, MCP provides the governed interface, with enforcement in the server.
Separating the tool surface: why two tools are better than one send endpoint with a type flag
The recommended surface splits a single send_email tool with a type parameter into send_transactional and send_broadcast. With a type flag, the enforcement layer has to read the payload content to find which rules apply. A named tool exposes that decision before body parsing through Mcp-Name. Routing can then select the appropriate schema, validation hooks, and rate cap. Payload validation is still necessary, but it no longer has to discover the compliance mode.
A compact transactional schema contains required to as an array of email-format strings, required template_id as a string, required idempotency_key as a string, and merge_vars as a typed object with declared required keys. It offers no free-form body. The broadcast schema instead contains required list_id, template_id, subject, and idempotency_key as strings, without an inline recipient array. The server resolves the list and applies suppression internally.
The broadcast tool also omits an agent-configurable unsubscribe_header field because the server inserts the unsubscribe mechanism unconditionally. Transactional sending still suppresses hard-bounced addresses even though it does not require the same unsubscribe handling. Two tools therefore reduce the agent's reasoning burden rather than expanding it. The model selects an operation whose contract is already defined, instead of deriving a bundle of rules from a flag and assembling the safeguards itself.
Schema discipline at the field level and what it prevents
Typing to as an array stops the model from passing a comma-separated string that a server might split the wrong way or reject without explaining how to fix it. Recipient structure is checked before dispatch begins. Likewise, required keys in merge_vars prevent a missing value from becoming an unrendered {{first_name}} in the delivered receipt. Requiring template_id and allowing no free-form transactional body keeps the content within the declared template contract.
The idempotency_key belongs in both tool schemas as a required field. That requirement forces its construction before the call can proceed, typically from the inbound event ID and action type hashed to a stable value. Error responses need equal discipline. Structured JSON with a machine-readable code and a specific fix lets the agent branch on a defined failure. Recipient and merge-variable validation then become actionable corrections.
A list_subscribers or read_inbox operation should paginate by default rather than return its entire result in one call. Inbox listings should return minimal metadata, including subject, sender, date, and message ID, while full content requires a separate get_message call. This keeps material the agent does not need out of the context window. A precise send schema cannot compensate for a surrounding tool surface that overwhelms the agent before it constructs the send.
Idempotency across two send modes and why one enforcement layer is not enough
A required key does not itself enforce idempotency. Duplicate sends can originate from a message.created webhook delivered twice, an agent loop retrying without a record of the previous run, or a scheduled agent replaying a failed run. These repeats can still lead to a send call with the right structure. For transactional mail, hashing the inbound event ID and action type gives retries the same key, so the provider can return the original result and prevent duplicate sends within its idempotency window.
Broadcast approval adds another network step that can be retried on its own. The approval callback endpoint should deduplicate on approval_id, while the email API call should use the key send:{approval_id}. Both layers need their own enforcement mechanism. Callback deduplication does not cover an independently retried send call, and send deduplication does not stop the approval callback from being processed repeatedly. Treating approval and dispatch as one operation hides the gap between them.
The two tools also need independent key namespaces and idempotency windows. Otherwise, keys derived from the same source event could collide across modes, suppressing a legitimate receipt or broadcast. Shared infrastructure provides one place to enforce both modes without leaving a seam between separate sending products. The provider's idempotency window sets a clear limit on how long a repeated key stops another dispatch.
Guardrail hooks and where they must sit relative to the agent's reasoning layer
Guardrails must execute below the agent's reasoning layer, in the MCP server or email API. A model must not be able to rewrite or disable the checks that govern its own output. Their independence is equally important to the design. Rate caps stop excess volume, recipient allowlists constrain direction, and idempotency enforcement stops repeats. None substitutes for the others, since an allowed recipient can still receive too many distinct messages or the same message twice.
Pre-send linting adds a different boundary by rejecting malformed or non-compliant sends before dispatch. An audit log explains what has already happened but cannot stop a send. Finding {{order_total}} or a missing List-Unsubscribe header after a broadcast cannot undo delivery, but rejecting the call synchronously at the tool boundary can stop that send. AgentSend places its guardrail layer at this point and returns machine-readable errors with specific fixes.
For broadcasts, suppression enforcement must also remain server-side and outside the tool's configurable parameters. The agent must have no argument that disables it. Sensitive campaigns can additionally require human approval through an interface designed for a decision in under a minute, with a rendered HTML preview, full recipient address, agent context panel, and deadline countdown. Approval should not require an open stream. The specification's Multi Round-Trip Requests pattern lets the server return resultType with the value "input_required" and lets the client retry with approval attached, subject to the separate callback and send deduplication controls.
Domain and sender reputation isolation when one caller operates both send modes
The same separation must extend beyond the MCP server. One caller sending both modes from the same domain creates a reputation dependency, because broadcast complaints can impair delivery of receipts and login links. Separate tools alone cannot remove that dependency. The recommended design sends broadcasts from a dedicated subdomain such as news.example.com and transactional messages from another, such as mail.example.com, with separate SPF, DKIM, and DMARC records. This establishes a domain boundary between the two sending workloads.
Authentication is a prerequisite for that design. Domain reputation has a greater effect on inbox placement than IP reputation, so SPF, DKIM, and DMARC should be aligned when sending is first set up. Both subdomains should use DMARC policy p=reject. A monitoring-only p=none policy or p=quarantine does not provide the prescribed enforcement posture for an autonomous sender that may run again before a quarantine signal receives attention.
Separate subdomains do take more work to run within a unified service. That work is a fixed part of the setup, but when broadcast complaints cause a problem with transactional delivery, messages that users need right away can be affected. One caller does not require one sending identity. The useful simplification is shared access to the infrastructure.
What the complete authenticated caller looks like end to end
A complete caller begins by discovering distinct transactional and broadcast tools, then constructs the selected operation against its typed schema. Validation happens before any message is dispatched.
Errors return as structured corrections the agent can use.
AgentSend provides a single API, MCP server, and CLI for configuring domains, composing messages, running broadcast campaigns, and handling transactional and opted-in marketing sends through one authenticated caller. Its pre-send guardrail layer fits the enforcement position this architecture requires, without splitting the workflow across two products or APIs. Agents are first-class senders whose retries, runtime decisions, and autonomous execution differ structurally from human-triggered sends, so the tool surface must make those differences enforceable rather than leave them for the model to reason through.


