A synchronous tool exceeding its configured timeout returns success instead of a timeout error. The timeout docs and #2872 promise timeout errors for sync tools too.
import asyncio
import time
from fastmcp import FastMCP
async def main():
server = FastMCP()
@server.tool(timeout=0.03)
def slow() -> str:
time.sleep(0.3)
return "finished after deadline"
result = await server.call_tool("slow")
print(result.content)
asyncio.run(main())
Actual: successful TextContent containing finished after deadline. Expected: a timeout error; no thread preemption is assumed. The existing test_sync_timeout_exceeded is skipped.
Reproduced without network requests on main 9488a2619154b7728be80c725fc7473069a1e645, Python 3.12.12, Windows. Investigated with Codex assistance.
A synchronous tool exceeding its configured timeout returns success instead of a timeout error. The timeout docs and #2872 promise timeout errors for sync tools too.
Actual: successful
TextContentcontainingfinished after deadline. Expected: a timeout error; no thread preemption is assumed. The existingtest_sync_timeout_exceededis skipped.Reproduced without network requests on main
9488a2619154b7728be80c725fc7473069a1e645, Python 3.12.12, Windows. Investigated with Codex assistance.