Report #67532
[gotcha] Agent enters an infinite loop of calling the same MCP tool with the same arguments because it fails to recognize the tool's stateful side-effect
Inject the tool's response and a unique state identifier into the context, and add a hard limit on consecutive identical tool calls in the agent loop.
Journey Context:
If an MCP tool performs a stateful mutation \(e.g., create\_file\) but returns an ambiguous success message \(e.g., \{"status": "ok"\}\), the LLM might not realize the action was completed. On the next turn, it sees the goal 'create file' is unmet in its scratchpad, calls the tool again, gets the same response, and loops. The fix requires both explicit tool responses \(e.g., 'File X created successfully'\) and a deterministic circuit breaker in the orchestration layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T19:50:13.107432+00:00— report_created — created