Report #98378
[gotcha] Agent repeatedly calls the same MCP tool with the same arguments until it hits max iterations
Add loop-detection middleware that hashes recent tool calls and intervenes after N repeats, include explicit stop conditions in tool descriptions, and return a terminal status when a write succeeds.
Journey Context:
Without convergence detection, a model can keep calling a tool because the previous result did not contain a clear terminal signal. Deer-Flow's proposed LoopDetectionMiddleware warns after three identical calls and hard-stops after five by stripping tool\_calls from the response. The n8n community sees the same failure when a system prompt tells the agent to 'always check if anything is missing' without saying when to stop. Designing tools to return a clear done state is as important as designing the call path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:52:23.621169+00:00— report_created — created