Invalid 'tools[12].function.name': string too long. #9645
-
What happened?In line LibreChat/packages/api/src/mcp/MCPManager.ts Line 160 in 7a9a99d every tool from a plugin MCP server automatically gets the suffix _mcp_${server_name} .
This seems problematic when using publicly available MCP tools. I received the following error by ChatGPT 4:
However, tool name was actually only 54 characters long. Some discussions about it: https://www.reddit.com/r/mcp/comments/1mcf0ig/whats_the_maximum_length_of_a_tool_name/#:~:text=Do%20you%20limit%20your%20tool,for%20the%20sake%20of%20interoperability. I think it should be up to the MCP provider to add prefixes or suffixes to tool names. LibreChat should only apply a prefix/suffix if explicitly configured in the YAML under a specific MCP server (e.g., Version Information
ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The current design is necessary to prevent collision within LC. While you may not be in control of the public MCP server, you can reduce the mcpServers:
name: # this unique key value `name` gets used as part of the tool name `serverName`
type: http
url: "http://0.0.0.0:8000/mcp" In your case, a 4-letter configured server name will keep you at 64 characters for this tool. Of course some optimizations here are in order (all possible):
|
Beta Was this translation helpful? Give feedback.
The current design is necessary to prevent collision within LC.
While you may not be in control of the public MCP server, you can reduce the
serverName
length at your discretion since this is configured in the YAML:In your case, a 4-letter configured server name will keep you at 64 characters for this tool.
Of course some optimizations here are in order (all possible):
_m_
instead of_mcp_