What are MCP tool annotations?
MCP tool annotations are optional hints a server attaches to a tool to describe its behaviour: whether it is read-only, destructive, idempotent, or reaches outside systems. Clients can use them to decide when to ask for confirmation. They are not enforcement. For a tool that spends money, leave readOnlyHint false and destructiveHint true, set idempotentHint true only if you really deduplicate, and put the actual controls in your payment path.
If you run an MCP server that can buy something, annotations are the smallest useful thing you can add, and the easiest to overtrust. This guide covers what the spec says, how we would label a real commerce tool set, and what still has to live on the server.
The five fields, from the spec
The MCP schema (2025-11-25) defines ToolAnnotations as an optional object on each tool. One display field and four behaviour hints:
| Field | If true, it means | Default |
|---|---|---|
title | A human-readable name (a string, not a boolean) | none |
readOnlyHint | The tool doesn't modify its environment | false |
destructiveHint | It may make destructive updates. If false, updates are additive only | true |
idempotentHint | Repeating the call with the same arguments has no additional effect | false |
openWorldHint | It may interact with an open world of external entities | true |
destructiveHint and idempotentHint only mean something when readOnlyHint is false. The defaults are deliberately pessimistic: a tool with no annotations is assumed to write, possibly destructively, not safely repeatable, and open-world.
{
"name": "search_plans",
"description": "Search the product catalog",
"inputSchema": { "type": "object" },
"annotations": {
"title": "Search plans",
"readOnlyHint": true,
"openWorldHint": false
}
}
What annotations are for, and what they can't do
The spec is blunt that every field is a hint and that clients should never make tool use decisions based on annotations from untrusted servers. The MCP team's March 2026 post on annotations sets out the practical split.
They help with: deciding when to show a confirmation, better approval UI, and input to a client's policy engine, especially for servers the client already trusts.
They don't:
- Stop prompt injection. A model that reads malicious content can still be steered into calling a correctly labelled tool.
- Enforce anything. Nothing in the protocol stops a tool marked read-only from writing.
- Prove honesty. An untrusted server can label a purchase tool as read-only.
- Capture combinations. Risk often comes from which tools share a session, such as one that reads private data alongside one that can send it out.
That post puts the line well: contracts belong in the authorization layer, transport or runtime rather than in ToolAnnotations. For a payment tool, that's the whole design rule.
How to label tools that spend money
Here's how the common commerce tool shapes map on. These are our recommendations, since the spec doesn't define payment-specific values.
| Tool type | readOnly | destructive | idempotent | openWorld |
|---|---|---|---|---|
| Search your own catalog | true | n/a | n/a | false |
| Get order status | true | n/a | n/a | false |
| Create a checkout link the human pays | false | false | only with a key | true |
| Charge a saved card off-session | false | true | only with a key | true |
| Send a top-up or issue a code | false | true | only with a key | true |
| Refund an order | false | true | only with a key | true |
Why a purchase should stay destructive
By the letter of the spec, a purchase could be called additive: it creates an order and overwrites nothing. We'd still leave destructiveHint at true. Clients use this hint to decide how carefully to treat a call, and money that has left, or a code that has been delivered, often can't be taken back. A hosted checkout link is different because the person's payment is a separate step, so false is defensible there.
Don't claim idempotency you haven't built
idempotentHint: true tells a client that a retry is harmless. If your tool generates a fresh key on each call, that's false, and a retried charge is a second charge. Build the key path first using our MCP tool idempotency checklist, then set the hint.
Read-only doesn't mean harmless
An order-status tool changes nothing, but it can return sensitive output, such as an eSIM activation code or a gift card number. It's correctly readOnlyHint: true, and it still needs proper access control. Annotations describe side effects, not data sensitivity.
What has to live on the server anyway
Assume a client ignores every hint. These controls should still hold:
- Human approval for money. Return a link the person pays, as in consent-first checkout, or use URL elicitation where the client supports it.
- Spending limits enforced where the charge happens. See how to set an AI agent spending limit.
- Idempotency keys carried from the tool call through to the payment provider.
- Authentication and authorization on every state-changing or sensitive endpoint, checked on the server.
- An audit trail recording which agent asked for what, and under whose approval.
Where cartapi stands today
Being specific, from the current source: cartapi's MCP server doesn't set annotations on its tools yet. A client therefore sees the spec's pessimistic defaults for all ten, including read-only ones like search_esim_plans. That errs on the safe side, but it means more confirmation prompts than the search tools deserve.
The default purchase path doesn't depend on hints: get_checkout_link and create_topup_checkout return a Stripe URL that the person opens and pays. As our idempotency post notes, those tools don't take an idempotency key yet, so we wouldn't mark them idempotent when we add annotations.
A quick rollout checklist
- List every tool and write down its real side effects.
- Mark tools that truly change nothing as
readOnlyHint: true. - Leave anything that moves money or issues a code as destructive.
- Set
idempotentHintonly where a tested key path exists. - Set
openWorldHint: falseonly for tools confined to your own data. - Add a test asserting the annotations for each tool, so a new tool can't ship unlabelled.
- Test with a client that ignores annotations and confirm your server-side limits still hold.
Related guides
Frequently asked questions
What are MCP tool annotations?
Optional metadata on an MCP tool that describes its behaviour: a title plus hints for read-only, destructive, idempotent and open-world. Clients can use them to decide when to ask for confirmation.
What is the default for readOnlyHint and destructiveHint?
readOnlyHint defaults to false and destructiveHint defaults to true, so a tool with no annotations is treated as one that may write destructively.
Are MCP tool annotations a security control?
No. They are hints, and the spec says clients should never make tool use decisions based on annotations from untrusted servers. Enforce limits on the server.
Should a payment tool be marked destructive?
We recommend yes for anything that charges or delivers value, even though a purchase is technically additive, because the result is often hard to reverse.
When can I set idempotentHint to true?
Only when repeating the call with the same arguments truly has no additional effect, which for a purchase means a real idempotency key carried through to the payment provider.
Does readOnlyHint mean a tool is safe to auto-approve?
Not always. A read-only tool can still return sensitive data, such as an activation code, so it needs access control and care about where its output goes.
Try it
Want to see a commerce MCP server in practice? Add cartapi from the install page or read the docs. Every default purchase ends with a person paying on Stripe.