Fix guides · check safety.annotations

Add readOnlyHint and destructiveHint annotations to MCP tools

Annotations tell clients which tools are safe to auto-approve and which need the user's confirmation.

6,576 of 15,360 reachable MCP servers (42.8%) have this issue today.

Why it matters

Clients such as Claude and Cursor use annotations to decide when to ask the user before a call. Without them every call is treated as potentially destructive (more prompts, slower agents) or, worse, a delete is treated like a read.

What to do

{ "name": "list_files", "annotations": { "readOnlyHint": true } }
{ "name": "delete_file", "annotations": { "readOnlyHint": false, "destructiveHint": true, "idempotentHint": true } }

TypeScript SDK

server.registerTool("list_files", { description: "…", inputSchema: {…}, annotations: { readOnlyHint: true } }, handler);

Python SDK

from mcp.types import ToolAnnotations

@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True))
def list_files(path: str) -> list[str]: ...

Check your server

Paste your endpoint at /check, or run it in CI:

pipx run glimind check https://your-server.example.com/mcp --min-grade B

Related