Tool annotations are the part of an MCP tool definition that reviewers ask about second. The first question is about tokens. The second is: "How does the client know which tools change data?" The honest answer is that annotations tell it what the server claims, and nothing enforces the claim. This tutorial covers what the annotations are, what they can and cannot prove, and how to build confirmation for destructive tools so that it holds when the client is not careful.
What the annotations are
The MCP specification lets a tool carry an annotations object next to its input schema. The fields in the current schema are:
title: a display name for the tool.readOnlyHint: if true, the tool does not modify its environment. Default: false.destructiveHint: if true, the tool may perform destructive updates rather than purely additive ones. Only meaningful whenreadOnlyHintis false. Default: true.idempotentHint: if true, repeating a call with the same arguments has no additional effect. Only meaningful whenreadOnlyHintis false. Default: false.openWorldHint: if true, the tool interacts with external entities beyond your system. Default: true.
Read the defaults twice. A tool with no annotations is described as non-read-only, destructive, non-idempotent, and open-world. That is the cautious default, and it means every tool you leave unannotated looks dangerous to a client that honors the hints. It also means a reviewer reading your tool list sees nothing about intent.
The specification says to distrust them
The schema documentation calls these properties hints and states that they are not guaranteed to describe actual behavior. The tools section of the specification says clients must treat annotations as untrusted unless they come from a trusted server. Treat that sentence as the design constraint.
Three consequences follow.
- A hint is not a control.
readOnlyHint: trueon a tool that writes does not stop the write. Nothing in the protocol checks it. The server's own authorization is the only control. - A hint can be wrong without malice. A tool starts read-only, someone adds a side effect such as a "last viewed" write or a cache warm, and the annotation is never updated. Your reviewer will find this one.
- A hint can be hostile. A server you did not write can mark a deleting tool as read-only so the client skips confirmation. If your product connects to third-party servers, this is your threat. If you only operate your own server, it is your customer's threat about everyone else's.
Set annotations from the tool's real behavior
For your own server, annotate every tool explicitly. Do not rely on defaults.
| Tool behavior | readOnlyHint | destructiveHint | idempotentHint | openWorldHint |
|---|---|---|---|---|
| Search tickets in your database | true | n/a | n/a | false |
| Create a ticket | false | false | false | false |
| Set a ticket's status | false | false | true | false |
| Delete a ticket, cancel an account | false | true | true | false |
| Send an email or webhook | false | false | false | true |
| Fetch a URL supplied by the caller | true | n/a | n/a | true |
Two cases need care. A tool that overwrites a field is destructive in the sense that matters to a user, even though no record disappears: the old value is gone. Mark it destructive unless you keep history the user can restore. And a tool that sends anything outside your system is open-world, even if it also writes locally.
Test the claim in CI
Make the annotation a tested statement. For each tool marked readOnlyHint: true, run the tool against a fixture tenant with a database that records writes, and assert that the write log is empty. For each tool marked idempotent, call it twice and compare state. The cost is a few dozen lines in the same harness you use for authorization regression tests. The benefit is that "the annotations are accurate" becomes something you can put in the evidence pack instead of something you assert.
Also diff the annotations on every release. A tool that moves from readOnlyHint: true to false, or that loses destructiveHint, should fail the build until a named person approves the change. This belongs to the same change-control process as the tool descriptions themselves.
Enforce confirmation on the server
Because clients may ignore hints, do not let confirmation depend on them. The pattern has three parts.
Classify by consequence, not by annotation. Keep an internal tier for each tool: read, reversible write, irreversible or access-changing write. The annotations are derived from this tier. Policy decisions use the tier.
Require a scope for the top tier. Irreversible and access-changing tools should demand their own OAuth scope, so a token granted for reading cannot call them whatever the client does. This is the ceiling described in the scope design tutorial.
Bind confirmation to the exact call. For the top tier, the tool should not execute on first invocation. It returns a pending-action record that states the target, the operation, and a short-lived confirmation identifier. A second call, or a response through the elicitation mechanism where the client supports it, confirms that identifier. The server checks that the confirmation belongs to the same user, the same tenant, and the same arguments, and that it has not expired or been used. A confirmation that is not bound to the arguments can be replayed against a different target.
Be exact with the user about limits. This control stops an agent that acts on a bad plan or an injected instruction. It does not stop a user who confirms without reading. Say so in the evidence pack rather than letting the reviewer assume otherwise.
What to log
Each destructive tool call should produce two audit events: the request that created the pending action, and the confirmation that executed it. Record the subject, tenant, tool name, target identifiers, the confirmation identifier, and the annotation values the server advertised at the time. If a dispute arises over what the client was told, the logged annotations answer it.
What to put in the evidence pack
- The full tool list with the four annotation values and the internal tier for each.
- The CI test that verifies read-only and idempotent claims.
- The release check that blocks silent annotation changes.
- A description of the confirmation flow for the top tier, including its stated limit.
When you do not need this
If your server exposes only read tools over data the user can already see, the tier model is overhead. Annotate the tools correctly, add the CI check that confirms no writes occur, and move on. The confirmation flow earns its cost when a tool can delete, send, pay, or change who has access.
If you want a second reader on your tool list before a customer review, that is a scoped piece of audit work, and we tell you in week one what we find.