← cartapi.io blog

What are MCP tool annotations?

Published 2026-11-21 · Last updated 2026-11-21 · 7 min read · Developer guide
TL;DR

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:

FieldIf true, it meansDefault
titleA human-readable name (a string, not a boolean)none
readOnlyHintThe tool doesn't modify its environmentfalse
destructiveHintIt may make destructive updates. If false, updates are additive onlytrue
idempotentHintRepeating the call with the same arguments has no additional effectfalse
openWorldHintIt may interact with an open world of external entitiestrue

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:

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 typereadOnlydestructiveidempotentopenWorld
Search your own catalogtruen/an/afalse
Get order statustruen/an/afalse
Create a checkout link the human paysfalsefalseonly with a keytrue
Charge a saved card off-sessionfalsetrueonly with a keytrue
Send a top-up or issue a codefalsetrueonly with a keytrue
Refund an orderfalsetrueonly with a keytrue

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:

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

  1. List every tool and write down its real side effects.
  2. Mark tools that truly change nothing as readOnlyHint: true.
  3. Leave anything that moves money or issues a code as destructive.
  4. Set idempotentHint only where a tested key path exists.
  5. Set openWorldHint: false only for tools confined to your own data.
  6. Add a test asserting the annotations for each tool, so a new tool can't ship unlabelled.
  7. 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.

About the author

Roc Chow

Roc Chow builds cartapi, the commerce layer for AI agents, and runs . The field definitions here are linked to the MCP specification. Statements about cartapi come from its MCP server source.

LinkedIn · · cartapi.io