MCP Shipyard
← Rules catalog

MCP delete/remove tool missing destructiveHint: true

Tools that delete, cancel, revoke or overwrite should set destructiveHint true and readOnlyHint false. Find mislabelled tools with jq and fix them.

majorannotations.destructive-not-flaggedClaude, ChatGPT

Set destructiveHint: true and readOnlyHint: false on tools that delete, overwrite, cancel or revoke. The rule's fix text adds that, for ChatGPT, being able to undo an action does not justify destructiveHint: false. The scanner reports annotations.destructive-not-flagged as major for Claude and ChatGPT.

What you see

  • A scan reports annotations.destructive-not-flagged: "cancel_order" looks destructive but destructiveHint is false.
  • A review asking you to correct hints. Portal wording is not verified here.

Why it happens

SDK defaults and copy-pasted annotation blocks leave destructiveHint false or unset. MCP annotations are hints, and the spec says clients must treat them as untrusted unless they come from a trusted server. The schema defaults destructiveHint to true and says it is meaningful only when readOnlyHint is false, so an unset hint is not a safe pass: this rule asks for an explicit true on tools that look destructive, and ChatGPT's review looks at the value you declare.

The scanner flags a tool whose name has a destructive verb in its first two words: delete, remove, drop, destroy, purge, revoke, cancel, wipe, erase, truncate, reset, kill or trash. A leading read verb cancels the match, so get_drop_rates and list_kill_events pass. Like the read rule, it checks only tools that carry an annotations object.

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(.name|test("(^|[_.-])(delete|remove|drop|destroy|purge|revoke|cancel|wipe|erase|truncate|reset|kill|trash)([_.-]|$)")) | select(.annotations.destructiveHint != true) | .name'

Fix

server.registerTool(
  "cancel_shipment",
  {
    description: "Cancels a shipment that has not left the warehouse. The label is voided.",
    inputSchema: { shipmentId: z.string().describe("Shipment ID, e.g. SH-8841") },
    annotations: {
      title: "Cancel shipment",
      readOnlyHint: false,
      destructiveHint: true,
      idempotentHint: true,
      openWorldHint: false,
    },
  },
  handler
);

Tools that create or update without removing data keep destructiveHint: false. Never mark a destructive tool readOnlyHint: true: that is flagged by annotations.write-marked-readonly, and read-only plus destructive together is flagged by annotations.contradictory. Read-side counterpart: annotations.read-tool-not-readonly.

Verify

Re-run the filter and expect no output.

Which clients care

Claude and ChatGPT, per the rule's platform tags.

Source

OpenAI plugin guidelines: https://developers.openai.com/plugins/plugin-guidelines

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