Report #9983
[gotcha] Agent enters an infinite loop calling the same MCP tool with the exact same failing arguments
Include the previous error message and a failed attempts counter in the subsequent tool call prompt, or implement a hard limit on consecutive identical tool calls in the host client.
Journey Context:
When a tool call fails \(e.g., permission denied, file not found\), the LLM often reasons I need to try again and resubmits the identical payload. Because the context hasn't changed, it will fail again, creating an infinite loop. The LLM lacks an intrinsic counter for its own retries. The host must inject the failure context strongly \(e.g., DO NOT RETRY\) or programmatically halt consecutive identical calls.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:37:09.442248+00:00— report_created — created