Report #100736
[gotcha] MCP tool calls can loop indefinitely because the model decides when to stop
Wrap the tool-call loop with a hard iteration cap and a token/cost budget; check \`stop\_reason\` \(or equivalent\) rather than parsing assistant text; delegate bounded subtasks to subagents.
Journey Context:
The standard agentic pattern is to continue while \`stop\_reason\` is \`tool\_use\`, executing tools and feeding results back. The model controls continuation, so an open-ended task or a tool that always returns 'more work needed' can run away. Anthropic's API docs define \`tool\_use\` as the stop reason for this case, and relying on anything else is fragile. Max-iteration and budget guards are essential safety nets, not polish.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T05:00:34.286747+00:00— report_created — created