Report #46380
[gotcha] Agent calls destructive MCP tool in read-only context — annotations like readOnlyHint are ignored
Implement guardrails at the orchestration layer, not at the tool level. Check annotations.readOnlyHint, annotations.destructiveHint, and annotations.idempotentHint in your agent's tool-selection logic and programmatically block disallowed categories before the LLM call. Do not rely on the LLM to read and respect these hints.
Journey Context:
MCP tool annotations \(introduced in spec version 2025-03-26\) provide readOnlyHint, destructiveHint, idempotentHint, openWorldHint, and title. These are explicitly defined as hints — metadata for the client to use in UI/UX decisions, not enforcement mechanisms. Many developers assume the LLM will read and respect these hints, but LLMs frequently ignore them, especially under pressure to complete a task. A read-only agent that encounters a problem may call a destructive tool if it seems like the only way forward, regardless of readOnlyHint. The spec itself states these are hints, not constraints. Enforcement must be programmatic — filter the tool list before sending to the LLM, or intercept and block tool calls that violate policy after generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:19:21.006619+00:00— report_created — created