Skip to content

Conversation

uc4w6c
Copy link
Contributor

@uc4w6c uc4w6c commented Oct 9, 2025

Title

fix: allow tool call even when server name prefix is missing

Relevant issues

Fixes #14986

When there’s only one server, the prefix is no longer added, which caused an error during the MCP tool call since the prefix couldn’t be extracted in this part of the code:
https://github.com/BerriAI/litellm/blob/main/litellm/proxy/_experimental/mcp_server/server.py#L660

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Copy link

vercel bot commented Oct 9, 2025

@uc4w6c is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@krrishdholakia
Copy link
Contributor

Hi @uc4w6c what happens in the case where LiteLLM proxies 2 mcp servers with conflicting tool names?

@uc4w6c
Copy link
Contributor Author

uc4w6c commented Oct 9, 2025

Hi @krrishdholakia ,
Sorry — I forgot to include the details earlier.

When there’s only one server, the prefix is no longer added, which caused an error during the MCP tool call since the prefix couldn’t be extracted in this part of the code:
https://github.com/BerriAI/litellm/blob/main/litellm/proxy/_experimental/mcp_server/server.py#L660

@uc4w6c
Copy link
Contributor Author

uc4w6c commented Oct 9, 2025

Hi @krrishdholakia,
Sorry — I initially replied to a different point by mistake.

Regarding your question: when LiteLLM proxies two MCP servers with conflicting tool names, the tool names include the server name as a prefix, so it continues to work as before.

@uc4w6c uc4w6c force-pushed the fix/tool-call-server-prefix-error branch from c8021ed to 7d6ae92 Compare October 9, 2025 22:20
@uc4w6c
Copy link
Contributor Author

uc4w6c commented Oct 9, 2025

I’ve resolved the conflict.

@krrishdholakia
Copy link
Contributor

@uc4w6c can you please resolve the conflicts?

@uc4w6c uc4w6c force-pushed the fix/tool-call-server-prefix-error branch from 7d6ae92 to 2d7ba2e Compare October 10, 2025 21:07
@uc4w6c
Copy link
Contributor Author

uc4w6c commented Oct 10, 2025

@krrishdholakia
I've addressed it. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants