MCPcopy Create free account
hub / github.com/livekit/agents / test_call_tool_function_tool

Method test_call_tool_function_tool

tests/test_tool_proxy.py:164–175  ·  view source on GitHub ↗

call_tool can execute a FunctionTool by name.

(self)

Source from the content-addressed store, hash-verified

162 await ts._handle_search({"query": ""})
163
164 async def test_call_tool_function_tool(self):
165 """call_tool can execute a FunctionTool by name."""
166 ts = ToolProxyToolset(
167 id="proxy",
168 tools=[WeatherToolset(), FinanceToolset()],
169 )
170 await ts.setup()
171
172 result = await ts._handle_call(
173 _mock_ctx(), {"name": "weather_tool", "parameters": {"city": "London"}}
174 )
175 assert "sunny in London" in str(result)
176
177 async def test_call_tool_with_multiple_args(self):
178 ts = ToolProxyToolset(

Callers

nothing calls this directly

Calls 6

setupMethod · 0.95
_handle_callMethod · 0.95
ToolProxyToolsetClass · 0.90
_mock_ctxFunction · 0.85
WeatherToolsetClass · 0.70
FinanceToolsetClass · 0.70

Tested by

no test coverage detected