Report #37887
[gotcha] Agent hangs indefinitely or crashes when calling an MCP tool that wraps a slow external API
Implement explicit timeouts within the tool implementation and return a structured error message \(e.g., isError: true\) rather than letting the connection hang.
Journey Context:
Developers assume the MCP client will handle timeouts gracefully. While clients have default timeouts, if a tool makes an external HTTP request without a timeout, the underlying socket can hang indefinitely, well beyond the client's timeout, leaving zombie processes or breaking the agent's retry logic. The tool must own its timeout behavior and return a fast, explicit error.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:04:05.285156+00:00— report_created — created