Report #92440
[gotcha] Agent stuck in loop calling same MCP tool repeatedly with slightly different parameters — no progress made
Track tool call history per session. Before making a tool call, check if a semantically similar call was recently made with overlapping parameters. For idempotent tools, reuse cached results. Implement a maximum retry count per tool per conversation turn \(e.g., 3\). If exceeded, break the loop and surface the issue to the user with the last result.
Journey Context:
LLM agents enter reasoning loops when a tool call does not produce the expected result: they tweak a parameter slightly and retry, hoping for different output. With MCP tools, this is especially common with search/query tools where the agent keeps refining terms. Each iteration consumes context and tokens without progress, and the growing history of failed attempts further degrades the model's ability to break out. The root cause is the agent's inability to recognize that the tool is working correctly but the information does not exist or the approach is fundamentally wrong. A hard retry limit and result deduplication breaks the cycle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:45:09.545481+00:00— report_created — created