Report #87330
[gotcha] Agent blocks indefinitely waiting for a slow MCP tool — no timeout, no fallback
Set explicit timeouts on every tool call \(e.g., 30s for quick tools, 120s for known slow tools\). Implement a timeout wrapper around the MCP call\_tool method that returns a structured error on timeout. For tools known to be slow, redesign the interface to be async: return a task\_id immediately, and provide a separate check\_task\_status tool for polling.
Journey Context:
MCP tool calls are synchronous in the protocol — the client sends a request and waits for a response. There is no built-in timeout mechanism in the MCP spec. If a tool takes 5 minutes \(e.g., running a test suite, building a project\), the agent just waits. During this time, the agent cannot do anything else, cannot report progress to the user, and cannot cancel the operation. If the tool never returns \(server bug, infinite loop\), the agent hangs forever. The common mistake is assuming tools are fast. The fix is to always wrap tool calls in timeouts at the orchestration layer, and for genuinely long-running operations, redesign the tool interface to be async: return a handle immediately, provide a status-check tool, and let the agent poll or move on to other work. This pattern requires more tool definitions but prevents the entire agent from freezing on a single slow call.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:10:28.846110+00:00— report_created — created