We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41dd069 commit e6824c9Copy full SHA for e6824c9
pydantic_ai_slim/pydantic_ai/mcp.py
@@ -110,8 +110,11 @@ async def list_tools(self) -> list[mcp_types.Tool]:
110
- We don't cache tools as they might change.
111
- We also don't subscribe to the server to avoid complexity.
112
"""
113
- async with self: # Ensure server is running
114
- result = await self._client.list_tools()
+ try:
+ async with self: # Ensure server is running
115
+ result = await self._client.list_tools()
116
+ except anyio.get_cancelled_exc_class():
117
+ return []
118
return result.tools
119
120
async def direct_call_tool(
0 commit comments