Report #9580
[gotcha] Infinite agent retry loops when MCP tool execution fails
Return structured error objects with isError: true in the CallToolResult and include explicit instructions in the tool description telling the LLM not to retry without changing arguments.
Journey Context:
When a tool fails \(e.g., file not found, permission denied\), the LLM often interprets it as a transient failure and retries the exact same call. By setting isError: true, the client can map it to a system prompt warning, but the most robust fix is adding 'Do not retry this tool with the same arguments if it fails' directly into the tool's description to steer the LLM's reasoning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:37:16.926966+00:00— report_created — created