# How do I set a timeout on an MCP tool call?

Set a timeout per request in your MCP client SDK, and when it expires before a response arrives, send a cancellation notification and stop waiting rather than hanging indefinitely; the spec expects every implementation to do this and expects SDKs to let you configure it per request rather than one fixed value for the whole connection.

A slow tool that's actually working can send progress notifications, and the spec allows a client to reset its timeout clock each time one arrives, since a progress update means the server hasn't stalled. That doesn't remove the risk on its own: the spec also says a client should still enforce a hard maximum regardless of how many progress notifications show up, so a server stuck emitting progress forever can't hold a call open indefinitely. [What are the ways a single tool call can fail](/answers/tool-calling/what-are-the-ways-a-tool-call-can-fail) covers the other failure shapes a timeout doesn't catch, like a call that returns the wrong result without ever being slow.

---

Sources:
- Model Context Protocol specification: Lifecycle: https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle (fetched 2026-09-13)

Source: https://tessary.ai/answers/mcp-tool-reliability/how-do-i-set-a-timeout-on-an-mcp-tool-call
More on Mcp tool reliability: https://tessary.ai/answers/mcp-tool-reliability
From Tessary, agent reliability for AI agents in production: https://tessary.ai
