I'm still tracking this down, but as far as I can tell, by the time we get to the code in pydantic_ai/_agent_graph.py function _prepare_request_parameters, we get to this line
--> 241 await asyncio.gather(
242 *map(add_tool, ctx.deps.function_tools.values()),
243 *map(add_mcp_server_tools, ctx.deps.mcp_servers),
244 )
And the MCP tools are already added to ctx.deps.function_tools in the actor.get_agentlet function in orchestrator.py line 173 in Orchestrator.get_once. So they get added twice and sent to the llm twice, which causes a confict because names are re-used.
I'll keep digging in a bit more and see if I can see why this is happening, but I'm brand new to this codebase and this project.. this is my first attempt at using it :(.
I'm still tracking this down, but as far as I can tell, by the time we get to the code in
pydantic_ai/_agent_graph.pyfunction_prepare_request_parameters, we get to this lineAnd the MCP tools are already added to ctx.deps.function_tools in the
actor.get_agentletfunction in orchestrator.py line 173 inOrchestrator.get_once. So they get added twice and sent to the llm twice, which causes a confict because names are re-used.I'll keep digging in a bit more and see if I can see why this is happening, but I'm brand new to this codebase and this project.. this is my first attempt at using it :(.