What are MCP tool annotations? Behavior hints

By

MCP tool annotations describe whether a tool reads, changes, or reaches external data. Learn what the hints mean and why servers still need access controls.

MCP tool annotations are metadata that describe a tool’s behavior. They tell a client whether an operation claims to be read-only, destructive, safe to repeat, or open to external interactions.

How to build an MCP server shows annotations on a working blog-search tool, including what the MCP Inspector displays.

How annotations work

The server includes an annotations object in a tool definition. The host can use those hints when presenting or scheduling calls.

Tool annotations describe behavior to the hostA server sends a tool definition with behavior hints. The host considers those hints alongside its own policy before calling the server, which enforces access controls.Tool definition andhintsHost policyTool callServer accesscontrols

The MCP schema defines these fields:

FieldMeaning when true
readOnlyHintThe tool does not modify its environment
destructiveHintThe tool may make destructive updates
idempotentHintRepeating the same arguments has no additional effect
openWorldHintThe tool may interact with an open world of external entities

The destructive and idempotent hints apply when the tool can modify its environment. A tool can change data and still be idempotent: setting an issue’s status to the same value twice is one example.

In coding tools

Claude Code documents using readOnlyHint and idempotentHint to identify calls it can repeat after a connection closes. It also runs read-only calls alongside other read-only calls.

The MCP connection guides for Codex, Cursor, and Grok Build do not specify equivalent handling of these hints. Connecting a server alone tells you nothing about how its annotations affect approvals or retries.

Details checked against each vendor’s documentation in November 2026.

A concrete example

The search_posts tool in the server-building tutorial reads an in-memory collection of published posts. Its registration includes:

annotations: { readOnlyHint: true, openWorldHint: false }

This is a field inside the tool registration. The handler searches a fixed local collection, so those annotations describe what the code does. The tutorial shows the Inspector’s READ-ONLY badge and the actual search results.

When to use them

Add accurate annotations when building tools. They help a client distinguish a local lookup from an operation that changes data or interacts with external systems.

When reviewing a server, compare its hints with its handler and credentials. A read-only operation should work with read-only access wherever the backing service supports it.

Pitfalls

The tools specification requires clients to treat annotations as untrusted unless the server is trusted. Enforce permissions in the server and backing service.

Safe to repeat and read-only mean different things. A tool that creates another record on every call needs different retry handling from one that sets a fixed value.

  • Tool calling: Tool calling is when a model names a function and its arguments, and the app runs it. How Claude Code, Codex, Cursor and Grok Build take that step.
  • Permission modes: Permission modes decide what a coding agent can do without asking. The modes in Claude Code, Codex, Cursor and Grok Build, and what YOLO mode really skips.
  • Sandbox: An agent sandbox limits which files and hosts a coding agent's commands can reach. How the boundary works in Claude Code, Codex, Cursor and Grok Build.

All AI glossary entries →

Want me to talk about your product? You can sponsor this site.