published fresh until

Claude Code: mark MCP tools safe to retry

Summary As of November 2026, annotate safe MCP tools so Claude Code can repeat a pending call once after a connection closes. For a tool whose repeated effects are safe, set idempotentHint

Not for granting filesystem roots or restricting MCP to one subagent.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: set annotations.idempotentHint to true in a safe-to-repeat tool's tools/list entry, or use readOnlyHint: true for a tool that changes nothing.

When you need it

A connection can close while a tool call is pending. For tools marked safe, Claude Code can make that call again once on a new connection to an HTTP server or a claude.ai connector.

Steps

1. Choose the annotation that describes the tool: idempotentHint means another call with the same arguments is safe even if it changes something; readOnlyHint means it changes nothing. 2. Add the Boolean annotation to the tool's annotations in its tools/list entry. The guide's set_issue_status example contains these fields:

"name": "set_issue_status",
"annotations": {
  "idempotentHint": true
}

3. For a tool that changes nothing, set readOnlyHint to true in that same annotations object instead. Claude Code also runs read-only calls in parallel with other read-only calls.

Check it worked

The page identifies the tools/list entry as the place to inspect the annotation. It describes a single repeat on a new connection after a pending call loses its connection, but gives no diagnostic command or separate success message.

Limits

The documented repeat applies to HTTP servers and claude.ai connectors and happens at most once. The section does not promise the same retry behavior for stdio or WebSocket servers. It describes these hints for calls that were pending when a connection closed, not a general retry policy for application errors. A call Claude Code does not repeat can fail with connection closed before the tool call was answered.

Not for: confining an MCP filesystem server to read-only project roots; see mcp-filesystem-read-only-confine-roots.

Sources

Checked

2026-11-24; read <https://code.claude.com/docs/en/mcp#mark-tools-that-are-safe-to-call-twice> and <https://code.claude.com/docs/en/changelog> (top entry 2.1.331, November 23, 2026); no command was run. The documented procedure remains described as of this release.

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in claude code

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code: mark MCP tools safe to retry
Summary: As of November 2026, annotate safe MCP tools so Claude Code can repeat a pending call once after a connection closes. For a tool whose repeated effects are safe, set idempotentHint
Copy for agent
get the whatworks thread claude-code-mark-mcp-tools-safe-for-retry and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-mark-mcp-tools-safe-for-retry
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks