add a timeout arguments on per-request basis (as per MCP specifications) (#601)

This commit is contained in:
Guillaume Raille 2025-04-29 14:58:48 +02:00 • committed by GitHub
commit 96e5327110
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -254,7 +254,10 @@ class ClientSession(
)
async def call_tool(
self, name: str, arguments: dict[str, Any] | None = None
self,
name: str,
arguments: dict[str, Any] | None = None,
read_timeout_seconds: timedelta | None = None,
) -> types.CallToolResult:
"""Send a tools/call request."""
return await self.send_request(
@ -265,6 +268,7 @@ class ClientSession(
)
),
types.CallToolResult,
request_read_timeout_seconds=read_timeout_seconds,
)
async def list_prompts(self) -> types.ListPromptsResult: