Skip to content

Commit a3c9a59

Browse files
committed
Fix MCP process_tool_call example
1 parent 9f9ee55 commit a3c9a59

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

docs/mcp/client.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,19 @@ call needs.
179179
from typing import Any
180180

181181
from pydantic_ai import Agent
182-
from pydantic_ai.mcp import MCPServerStdio, ToolResult
182+
from pydantic_ai.mcp import CallToolFunc, MCPServerStdio, ToolResult
183183
from pydantic_ai.models.test import TestModel
184184
from pydantic_ai.tools import RunContext
185-
from pydantic_ai.toolsets.processed import CallToolFunc
186185

187186

188187
async def process_tool_call(
189188
ctx: RunContext[int],
190189
call_tool: CallToolFunc,
191190
name: str,
192-
tool_args: str | dict[str, Any] None,
193-
*args: Any,
194-
**kwargs: Any
191+
tool_args: dict[str, Any],
195192
) -> ToolResult:
196193
"""A tool call processor that passes along the deps."""
197-
return await call_tool(name, tool_args, *args, metadata={'deps': ctx.deps}, **kwargs)
194+
return await call_tool(name, tool_args, {'deps': ctx.deps})
198195

199196

200197
server = MCPServerStdio('python', ['mcp_server.py'], process_tool_call=process_tool_call)

0 commit comments

Comments
 (0)