Report #21431
[gotcha] Agent stuck in an infinite loop of calling an MCP tool, failing, and retrying with the same arguments
Return structured, actionable error messages from the MCP tool. Include a 'recovery\_hint' or explicit instruction on what to change, and implement a max-retry circuit breaker on the client side.
Journey Context:
When a tool fails with a generic error \(e.g., 'Execution failed'\), the LLM often reasons 'I need to try again' and sends the exact same parameters. The MCP spec allows arbitrary error objects. By returning a specific error \(e.g., 'Permission denied: API key missing. Do not retry without asking user for key.'\), you break the LLM's assumption that the failure is transient, preventing the loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:22:48.197288+00:00— report_created — created