Skip to content
AX Principles
AX-SYS-23Intermediate

Declare every tool's side effects before it is called

Declara los efectos de cada herramienta antes de que se llame

#all-industries#mcp

Tell the client up front whether each tool reads or writes, whether a write can destroy something, whether a retry is safe, and whether the tool reaches outside your system, so it can decide when to stop and ask the user.

Why

An agent's client has to decide, before every call, whether to run a tool silently or put a confirmation in front of the user. It can only make that call well if the tool says what it does. MCP gives servers four flags for this in ToolAnnotations: readOnlyHint, destructiveHint, idempotentHint and openWorldHint. The defaults are the cautious ones: a tool with no annotations is assumed to write (readOnlyHint false), to be destructive (destructiveHint true), not to be idempotent and to reach an open world. Leaving them unset therefore buries harmless reads under confirmation prompts, and a wrong false lets a delete through without one. OpenAI's app submission guidelines require explicit booleans on every tool and spell out what counts as destructive: deletion, overwriting, cancellation, access revocation, irreversible sends or transactions. Anthropic's guidance for MCP server authors makes the same point: annotations disclose which tools need open-world access or make destructive changes. The flags are hints, not guarantees. The MCP schema tells clients never to base tool use decisions on annotations from untrusted servers, and OpenAI notes that annotations do not replace authorization, input validation or human confirmation. Declare them honestly and still enforce the real checks on the server.

Do

Set all four annotations explicitly on every tool, using the cautious value when in doubt.

Don't

Mark a tool read-only or non-destructive to avoid confirmation prompts, or treat the flags as your only safeguard.

Artifact

{
  "name": "cancel_subscription",
  "description": "Cancel a customer's subscription at the end of the current billing period.",
  "inputSchema": {
    "type": "object",
    "properties": { "subscription_id": { "type": "string" } },
    "required": ["subscription_id"]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": true,
    "openWorldHint": false
  }
}

Citations

  1. [01]
    MCP Specification 2026-07-28: Schema (ToolAnnotations) ↗

    readOnlyHint: if true, the tool does not modify its environment (default false); destructiveHint: if true, the tool may perform destructive updates, if false it performs only additive updates (default true); idempotentHint defaults to false and openWorldHint to true. All properties in ToolAnnotations are hints, and clients should never make tool use decisions based on ToolAnnotations received from untrusted servers

  2. [02]
    OpenAI Apps SDK: App submission guidelines ↗

    Set readOnlyHint, destructiveHint, and openWorldHint to explicit boolean values in each tool's annotations object; for writes, use destructiveHint true for potentially destructive or irreversible effects such as deletion, overwriting, cancellation, access revocation, or irreversible sends or transactions. Annotations inform client safeguards; they do not grant permission or replace authentication, authorization and scope checks, input validation, or human confirmation for irreversible operations

  3. [03]
    Anthropic Engineering: Writing effective tools for AI agents ↗

    If you're writing tools for an MCP server, tool annotations help disclose which tools require open-world access or make destructive changes