@@ -144,7 +144,8 @@ async def test_agent_convert_schemas_true():
144
144
agent = Agent (
145
145
name = "test_agent" , mcp_servers = [server ], mcp_config = {"convert_schemas_to_strict" : True }
146
146
)
147
- tools = await agent .get_mcp_tools ()
147
+ run_context = RunContextWrapper (context = None )
148
+ tools = await agent .get_mcp_tools (run_context )
148
149
149
150
foo_tool = next (tool for tool in tools if tool .name == "foo" )
150
151
assert isinstance (foo_tool , FunctionTool )
@@ -208,7 +209,8 @@ async def test_agent_convert_schemas_false():
208
209
agent = Agent (
209
210
name = "test_agent" , mcp_servers = [server ], mcp_config = {"convert_schemas_to_strict" : False }
210
211
)
211
- tools = await agent .get_mcp_tools ()
212
+ run_context = RunContextWrapper (context = None )
213
+ tools = await agent .get_mcp_tools (run_context )
212
214
213
215
foo_tool = next (tool for tool in tools if tool .name == "foo" )
214
216
assert isinstance (foo_tool , FunctionTool )
@@ -245,7 +247,8 @@ async def test_agent_convert_schemas_unset():
245
247
server .add_tool ("bar" , non_strict_schema )
246
248
server .add_tool ("baz" , possible_to_convert_schema )
247
249
agent = Agent (name = "test_agent" , mcp_servers = [server ])
248
- tools = await agent .get_mcp_tools ()
250
+ run_context = RunContextWrapper (context = None )
251
+ tools = await agent .get_mcp_tools (run_context )
249
252
250
253
foo_tool = next (tool for tool in tools if tool .name == "foo" )
251
254
assert isinstance (foo_tool , FunctionTool )
0 commit comments