The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
rename transform_openai_tool_call_request_to_mcp_tool_call_request
Ishaan Jaff815263f7bcab
diff --git a/litellm/experimental_mcp_client/tools.py b/litellm/experimental_mcp_client/tools.pyindex f4ebbf4af4d..592b0767fd9 100644--- a/litellm/experimental_mcp_client/tools.py+++ b/litellm/experimental_mcp_client/tools.py@@ -76,7 +76,7 @@ def _get_function_arguments(function: FunctionDefinition) -> dict:return arguments if isinstance(arguments, dict) else {}-def _transform_openai_tool_call_to_mcp_tool_call_request(+def transform_openai_tool_call_request_to_mcp_tool_call_request(openai_tool: ChatCompletionMessageToolCall,) -> MCPCallToolRequestParams:"""Convert an OpenAI ChatCompletionMessageToolCall to an MCP CallToolRequestParams."""@@ -100,8 +100,10 @@ async def call_openai_tool(Returns:The result of the MCP tool call."""- mcp_tool_call_request_params = _transform_openai_tool_call_to_mcp_tool_call_request(- openai_tool=openai_tool,+ mcp_tool_call_request_params = (+ transform_openai_tool_call_request_to_mcp_tool_call_request(+ openai_tool=openai_tool,+ ))return await call_mcp_tool(session=session,diff --git a/tests/litellm/experimental_mcp_client/test_tools.py b/tests/litellm/experimental_mcp_client/test_tools.pyindex 7089d832177..ec430ecc9bf 100644--- a/tests/litellm/experimental_mcp_client/test_tools.py+++ b/tests/litellm/experimental_mcp_client/test_tools.py@@ -19,11 +19,11 @@ from mcp.types import Tool as MCPToolfrom litellm.experimental_mcp_client.tools import (_get_function_arguments,- _transform_openai_tool_call_to_mcp_tool_call_request,call_mcp_tool,call_openai_tool,load_mcp_tools,transform_mcp_tool_to_openai_tool,+ transform_openai_tool_call_request_to_mcp_tool_call_request,)@@ -76,11 +76,11 @@ def test_transform_mcp_tool_to_openai_tool(mock_mcp_tool):}-def test_transform_openai_tool_call_to_mcp_tool_call_request(mock_mcp_tool):+def testtransform_openai_tool_call_request_to_mcp_tool_call_request(mock_mcp_tool):openai_tool = {"function": {"name": "test_tool", "arguments": json.dumps({"test": "value"})}}- mcp_tool_call_request = _transform_openai_tool_call_to_mcp_tool_call_request(+ mcp_tool_call_request = transform_openai_tool_call_request_to_mcp_tool_call_request(openai_tool)assert mcp_tool_call_request.name == "test_tool"diff --git a/tests/pass_through_tests/test_mcp_routes.py b/tests/pass_through_tests/test_mcp_routes.pyindex d496a430afd..3435d53585f 100644--- a/tests/pass_through_tests/test_mcp_routes.py+++ b/tests/pass_through_tests/test_mcp_routes.py@@ -10,7 +10,7 @@ from mcp import ClientSessionfrom mcp.client.sse import sse_clientfrom litellm.experimental_mcp_client.tools import (transform_mcp_tool_to_openai_tool,- _transform_openai_tool_call_to_mcp_tool_call_request,+ transform_openai_tool_call_request_to_mcp_tool_call_request,)import json@@ -73,7 +73,7 @@ async def test_mcp_routes_with_vertex_ai():# Call the tool using MCP clientmcp_tool_call_request = (- _transform_openai_tool_call_to_mcp_tool_call_request(+ transform_openai_tool_call_request_to_mcp_tool_call_request(openai_tool.model_dump()))