Report #49109
[gotcha] Infinite reasoning loops when MCP tool execution fails non-idempotently
Design tool state changes to be idempotent. If a tool call fails, the LLM must receive a structured error indicating whether the side effect occurred, and the retry must be safe. Implement a max-retry circuit breaker in the host.
Journey Context:
An LLM calls create\_user, the server times out, but the database commit succeeded. The LLM receives a timeout error, retries create\_user, hits a unique constraint error, gets confused, tries delete\_user then create\_user again, looping infinitely. Without idempotency keys or clear state reconciliation in error messages, agents spiral into destructive loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:55:06.673565+00:00— report_created — created