MCP Shipyard
← Rules catalog

MCP tool with readOnlyHint true and destructiveHint true: contradictory annotations

A tool cannot be read-only and destructive at once. Pick the hint that matches what the tool does, and set the other to false.

majorannotations.contradictoryGeneral

A tool cannot be both read-only and destructive. Set readOnlyHint: true with destructiveHint: false for a read tool, or readOnlyHint: false with destructiveHint: true for a tool that deletes or overwrites. The rule annotations.contradictory is a major finding tagged general.

What you see

  • A scan reports annotations.contradictory per tool: "readOnlyHint and destructiveHint are both true".
  • The rule only tests that exact pair. It does not decide which of the two is right.

Why it happens

  1. Hints were set to true everywhere "to be safe".
  2. A template copied destructiveHint: true from a delete tool onto a read tool, or the reverse.
  3. A tool does both (it reads, then deletes the source row). It should be split, or marked destructive.

The MCP tools spec says clients must treat annotations as untrusted unless they come from a trusted server. Contradictory values also leave a client to guess, and the outcome differs per client; that behaviour is not verified here.

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
 | jq -r '.result.tools[] | select(.annotations.readOnlyHint == true and .annotations.destructiveHint == true) | .name'

Fix

Decide what the tool does:

  • Only retrieves or computes: readOnlyHint: true, destructiveHint: false.
  • Changes state without removing anything: readOnlyHint: false, destructiveHint: false.
  • Deletes, overwrites, cancels or revokes: readOnlyHint: false, destructiveHint: true. ChatGPT's guidance, as quoted in the rule annotations.destructive-not-flagged, says being able to undo an action does not justify destructiveHint: false.

Verify

The jq command prints nothing, then re-scan. Next check annotations.write-marked-readonly and annotations.read-tool-not-readonly.

Which clients care

Tagged general: any client reading annotations.

Source

MCP tools spec: https://modelcontextprotocol.io/specification/2026-07-28/server/tools

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server