Claude Code Now Retries Based on Your MCP Annotations: Lessons From Labeling 105 Tools
Future_AGI · reddit · 2026-10-28
Since Claude Code 2.1.307 (Oct 21), if an HTTP connection drops mid-call and the call may have run, Claude Code re-sends it once — and only if the tool is marked readOnlyHint or idempotentHint; read-only tools also run in parallel with other reads, while everything else fails with "connection closed before the tool call was answered." MCP annotations now change what a real client does. The author labeled all four hints on 105 tools in their open-source eval/observability MCP server and shares five lessons:
- Generate hints from your API contract: a Swagger contract plus a small YAML catalog yields 65 read-only, 10 idempotent writes, and 30 writes Claude Code won't re-send — hand-writing 105 annotation blocks would never stay correct.
- Two of their GETs actually write (e.g. getprompttemplate creates a draft), so the catalog marks them as writes and the server enforces write access.
- Some PATCHes aren't idempotent: updateevaltask's freshrun mode deletes previous results and reruns evals, incurring charges; it's overridden to idempotent: false + destructive, since a re-send could double-execute.
- openWorldHint goes on the 13 tools that hand work to an outside model provider (runprompt, rundatasetevals, runsimulation, etc.).
- When a write's response is too big, return a receipt: a committed write over the 64 KB cap returns its id and status with "The operation succeeded" — an error there invites retrying something that already happened, the double-execution bug issue #3394 reproduces 20/20 runs (still open).
More from coding & agent
- a16z: AI agents' task length doubles every 7 months as Databricks bets on agents' system of record — _AustinCalvert_ · 2026-10-28
- Will DePue pitches OpenAI: add API-style fan-out so multi-agent systems dispatch 1000s of tiny cheap models — willdepue · 2026-10-28
- Early users praise DeckWerk after weeks of using it for real talks — vincesitzmann · 2026-10-28
- Agentic video editing goes pro: senior editors 5x output, costs to collapse — dotey · 2026-10-28
- Software is going agent-first: sites, browsers, even a new Rust-like language built for agents — mobileraj · 2026-10-28
- HABIT-Bench: Best agent memory system scores just 33.61% at inferring user habits — SJTU · 2026-10-28