From 7db4ed7bbb13d7f62995ab9f67adf3ff9a3ffb82 Mon Sep 17 00:00:00 2001 From: Omar Abdelwahab Date: Wed, 5 Nov 2025 13:21:12 -0800 Subject: [PATCH] fix: update MCP tool runtime provider to use new function signatures Updated list_mcp_tools and invoke_mcp_tool calls to use named parameters instead of positional arguments to match the refactored API signatures. --- .../model_context_protocol/model_context_protocol.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/llama_stack/providers/remote/tool_runtime/model_context_protocol/model_context_protocol.py b/src/llama_stack/providers/remote/tool_runtime/model_context_protocol/model_context_protocol.py index 578bb6d34..e5b0bc3f7 100644 --- a/src/llama_stack/providers/remote/tool_runtime/model_context_protocol/model_context_protocol.py +++ b/src/llama_stack/providers/remote/tool_runtime/model_context_protocol/model_context_protocol.py @@ -45,7 +45,7 @@ class ModelContextProtocolToolRuntimeImpl(ToolGroupsProtocolPrivate, ToolRuntime if mcp_endpoint is None: raise ValueError("mcp_endpoint is required") headers = await self.get_headers_from_request(mcp_endpoint.uri) - return await list_mcp_tools(mcp_endpoint.uri, headers) + return await list_mcp_tools(endpoint=mcp_endpoint.uri, headers=headers) async def invoke_tool(self, tool_name: str, kwargs: dict[str, Any]) -> ToolInvocationResult: tool = await self.tool_store.get_tool(tool_name) @@ -56,7 +56,12 @@ class ModelContextProtocolToolRuntimeImpl(ToolGroupsProtocolPrivate, ToolRuntime raise ValueError(f"Endpoint {endpoint} is not a valid HTTP(S) URL") headers = await self.get_headers_from_request(endpoint) - return await invoke_mcp_tool(endpoint, headers, tool_name, kwargs) + return await invoke_mcp_tool( + endpoint=endpoint, + tool_name=tool_name, + kwargs=kwargs, + headers=headers, + ) async def get_headers_from_request(self, mcp_endpoint_uri: str) -> dict[str, str]: def canonicalize_uri(uri: str) -> str: