Agents
Designing APIs for AI Agents: What Resend's Docs and Tools Reveal
A cited Claude Code study favored Resend, but a broader one favored Postmark. The durable lessons are in documentation, tool design, permissions and error handling.
Ask Claude Code to recommend an email provider, and it picked Resend first in 64 of 102 email recommendations researchers could extract in a study cited by Latent Space. A later, more comprehensive study told a different story: Postmark came out on top for most models. 1 The lesson isn't that one documentation trick wins an agent's favor. Discoverability, callable tools, and the guardrails around actions all determine whether an agent can use a service well.
What does Resend's example show about agent-ready API documentation?
In the same study, SendGrid ranked first seven times and showed up 55 times as an alternative. 1 So an agent sometimes preferred Resend. That's the finding. Why it happened is not. Latent Space doesn't say which documentation elements swayed the model, and the reported detail isn't enough to treat these numbers as a durable market ranking. 1
That gap matters for API teams. A recommendation result can reflect how information is exposed and retrieved. It isn't proof that a specific format caused the selection. The later, broader study putting Postmark first is a reminder that these rankings move with the scope of the test. 1
Resend's pricing page offers a concrete, separate example: a volume slider for people, and a .md suffix on the URL that returns a table an agent can read in one request. 1 That's a real improvement in machine-readable access. It isn't evidence that this format drove the earlier recommendation numbers. The two facts just happen to sit in the same article.
Analysis: Treat agent-ready documentation as part of the product interface, not a marketing page with a bonus export format. An agent needs to know what the service does, whether it fits the task at hand, how to authenticate, what the limits are, and what happens when a call fails. Examples help, but only if they clearly separate supported behavior from assumption.
A simple test: can an agent pick the right service, judge when it applies, and act on it without guessing at ambiguous prose? That's a product-quality question, not just a documentation one.
Why should documentation and callable tools be designed together?
Documentation lets an agent understand and choose a service. Tools let it act once it has chosen. These are different problems. An agent can understand an API perfectly and still have no usable tool for the job, or have a tool sitting right there with no idea when to call it.
Resend's two efforts show both sides. The pricing page is the documentation side. The tool side went the other direction: its MCP server grew from roughly 20 tools or fewer at launch to more than 80 by the time of the interview. 1 Compare that to Cloudflare's Code Mode server, which exposes its API through two tools: search() and execute(). 1
Neither approach wins by default. Many narrowly named tools make a single operation easy to find, but every tool added is more surface area to document, maintain, and permission. A search-and-execute pair cuts the number of choices an agent has to make, and pushes the hard part into query construction, execution policy, and validation instead.
Analysis: Good AI agent tool design means describing every callable operation the way an agent needs it described: purpose, required inputs, side effects, authorization needs, failure responses, retry safety. Treat that description as part of the API contract. A tool name alone doesn't tell a caller what it's allowed to do or what happens after a timeout.
What should an API expose as a tool, and what should stay human-controlled?
Resend co-founder and CEO Zeno Rocha framed the goal simply: let someone in a chat client do what they could already do in the dashboard. Sending email was the obvious case; inviting teammates, checking usage, and managing billing were further examples he gave. 1
Those actions are not equally risky. Checking usage is a read. Inviting a teammate changes who has access to the account. Sending email creates an effect outside the system entirely. Managing billing touches money. Treat every dashboard action as equally safe to hand an agent, and you erase distinctions that matter.
Analysis: Classify operations by their effects, then build permissions and confirmation around that classification. Separate reads from writes wherever possible. Force high-impact actions to be explicit: require the caller to supply constraints like recipient scope, sender identity, or message content for an email. If a request is ambiguous, have the tool state what it plans to do and wait for confirmation. For a related look at approval controls when agents spend money, see ChatGPT Wallet's user-approved purchases for AI agents.
For a buyer evaluating the integration, the useful questions are specific: What identity and permissions does the agent operate under? Can it send on someone's behalf? Which actions need confirmation? What lands in an audit trail? How are boundaries enforced across users and organizations? Latent Space raises these questions about Resend's tools without answering them. 1
How do tool size and response design affect reliability?
Rocha described reviewing expanded tool calls in his own sessions. Latent Space recounts one case where a tool's result was too large to fit in the model's context, and notes that trimming the number of tools wouldn't have shrunk that one oversized response. 1
That separates two problems people tend to merge. Tool count governs discovery and selection. Response size governs how much the agent has to process after the call succeeds. Fixing one doesn't touch the other.
Analysis: Bound responses, and let callers ask for only what the next decision requires. Pagination, field selection, concise summaries with drill-down, and explicit truncation flags all help. A dashboard-shaped response can contain the right answer and still bury it.
Measure the agent's actual path, not just endpoint latency. How large are tool responses in practice? How often do they get truncated? Does the agent make repeated calls chasing the same data? Does it give up on a workflow after one oversized response? Latent Space gives one example of an oversized result but no frequency data and no report of what Resend changed afterward. 1
For buyers: ask whether a tool hands back only what's needed for the next step, or an account-sized payload the agent has to sort through on its own.
What breaks when an agent sends email or changes account state?
A write can succeed even when the caller never finds out. If an agent times out waiting for a send confirmation, it may have no idea whether the email went. Retry immediately, and you might send it twice.
Analysis: This is an API design problem, not a prompting problem. For externally visible writes, document a deduplication strategy (a stable request identifier works) and make the operation's state legible. A good response contract distinguishes validation failure, authorization failure, accepted work, completed work, and genuinely unknown outcome. Retry behavior should be spelled out per operation: a read is usually safe to repeat; an invitation, a billing change, or a send probably needs a status check first.
Errors should let the agent recover without guessing: name the rejected input, state whether anything actually changed, and say whether a follow-up read makes sense. If the outcome is unknown, say so; don't leave the next step implied.
There's a second-order failure mode too. Latent Space describes how a shared tracking domain can expose one customer's email links to reputational harm if another customer on the same domain gets blocklisted for phishing; the article says Resend introduced custom tracking domains and explains why. 1 Email operations carry consequences that live well outside the immediate API response.
How should platform teams evaluate an agent-ready API?
Analysis: Cover the full path, from finding an operation to recovering from a failed one.
- Documentation retrieval: Can the agent find the right endpoint, understand the use case, locate pricing and limits, and tell examples apart from guarantees? Resend's
.mdpricing table shows information made readable in one request, not that this feature alone drives provider selection. 1 - Tool selection: Hand the agent a read-only lookup, a constrained write, an ambiguous request, and an unsupported one. Does it pick the narrowest fitting capability and ask for missing information instead of improvising?
- Authorization: Try requests with insufficient permissions, incomplete identity, excessive scope, and conflicting constraints. A tool's name tells you nothing about whether its permissions are actually safe.
- Failure recovery: Test timeouts, validation errors, partial results, expired credentials, unknown outcomes. Can the agent recover without repeating an external action?
- Data boundaries: Check whether responses carry unnecessary account data, whether pagination behaves predictably, and whether callers can request only the fields they need.
Ask vendors directly for the tool catalog, schemas, side-effect descriptions, permission model, confirmation rules, error taxonomy, retry guidance, audit capabilities, and response-size limits. Latent Space raises most of these as open questions about Resend's own integration; it doesn't supply the answers. 1
What should API leaders do next?
Analysis: Make one source of truth serve people and agents alike, with stable, machine-readable guidance for pricing, authentication, setup, limits, and error handling. Start with a small set of high-value operations, make their inputs, permissions, and side effects explicit, and expand the tool surface only when usage and safety data justify it.
Wrap policy checks around every write, accounting for user, organization, resource, and financial scope, and require confirmation for anything that can send, invite, purchase, delete, or otherwise reach outside the current session. OpenAI's Control Room offers a useful lens on how internal workload controls can inform this kind of governance.
Instrument the agent path separately from ordinary API traffic: tool-selection failures, malformed calls, permission denials, retries, response sizes, confirmation drop-off, unknown outcomes. None of that shows up in endpoint response time. When agents do fail in production, Google's AQuA work on root-cause analysis for agent failures is a relevant next read.
While building its sending API, Resend's team heard from developers that producing good-looking emails was painful, so it shipped React Email. Developers could pair React Email with SendGrid, and Resend documented that setup. 1 Start with the workflow people actually have, then decide what gets documented, what gets made callable, and what stays under a human's hand.
An API is agent-ready when an agent can find the right operation, act within bounded authority, read the result correctly, and recover without guessing when things go sideways. Readable docs are a start. Run your own API through the checklist above and see how many boxes it actually clears.
Sources
1 "Designing for Agents — Zeno Rocha, Resend," Latent Space, https://latent.space/p/resend/
Questions
- What did Claude Code recommend in the cited email-provider study?
- The study cited by Latent Space found Resend ranked first in 64 of 102 extractable recommendations. SendGrid ranked first seven times and appeared 55 times as an alternative. A later, more comprehensive study was more competitive, with Postmark ranking first for most models. [1]
- Does machine-readable documentation guarantee that an agent will choose an API?
- No. Latent Space reports that Resend’s pricing page can expose a readable table by adding “.md,” but the source does not establish that this feature caused the recommendation results. [1]
- How many tools did Resend’s MCP server expose?
- Latent Space says it grew from roughly 20 tools or fewer at launch to more than 80 by the time of the interview. The source does not provide the individual schemas or permission boundaries for those tools. [1]
- What should teams ask before allowing an agent to send email or manage an account?
- Ask about permissions, confirmation steps, auditability, error handling, retries, ambiguous outcomes, data-access boundaries, and response-size limits. Latent Space raises these questions but does not answer them for Resend. [1]
- Why are tool responses a design concern?
- Latent Space describes a case where a tool result was too large for the model’s context and notes that reducing tool count alone would not shrink the result. Teams should therefore evaluate response bounds, pagination, field selection, and truncation behavior separately from tool discoverability. [1]
Sources
- Designing for Agents — Zeno Rocha, Resend · Latent Space · Nov 10, 2026
How this article was made: an AI writer persona researched and wrote it from the sources listed above; separate AI passes edited it, checked its claims against those sources and audited it; an editor at Yelno reviewed and approved it before publication. How the Yelno blog works · Follow Yelno on LinkedIn