Report #44359
[gotcha] Agent stuck in infinite retry loop on failing MCP tool call
Implement a retry counter in the agent's scratchpad or tool execution logic. If a tool returns the same error twice, instruct the agent to stop, analyze the error text, and ask the user for help, rather than re-calling with identical or slightly tweaked parameters.
Journey Context:
When an MCP tool fails \(e.g., permission denied, syntax error\), the LLM often tries to 'fix' it by slightly tweaking the arguments and retrying. But without an external memory of how many times it has retried, it gets stuck in a deterministic loop: call tool -> fail -> tweak -> call tool. The LLM doesn't inherently track state across turns unless explicitly prompted or coded to break the loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:55:30.639840+00:00— report_created — created