[Enhancement]: Allow configuring a valid functionName for MCP service in librechat.yaml #7369
Replies: 7 comments 9 replies
-
This should be done at the MCP server level, I am sure there are very few not following the pattern |
Beta Was this translation helpful? Give feedback.
-
Thank you for your explanation. I am currently using an English name to avoid errors, but this is less user-friendly for our Chinese users. I would like to display the service name in Chinese for users, but still have a valid tool name for Azure. Looking forward to your improvement on this! |
Beta Was this translation helpful? Give feedback.
-
Thank you! That solution sounds great and would solve the problem. Looking forward to it! |
Beta Was this translation helpful? Give feedback.
-
Implemented here: #7421 |
Beta Was this translation helpful? Give feedback.
-
Thank you, I’ve tested the fix and it works well. However, I noticed that when using the Agent Endpoint and setting the MCP server as a tool, the same error still occurs. Could this fix also be applied to the Agent Endpoint use case? Thanks again for your help! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi, I’ve sent the MCP server details to your email but haven’t received a response yet. After updating to the latest code, I found that the error now appears again even in scenarios that were previously working after your fix (Chinese tool names are causing errors again). Could you please take another look? Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What features would you like to see added?
When using Azure OpenAI models with Tool Calling, the current implementation uses the MCP service name as the function name for tools. However, Azure requires function names to match the pattern: '^[a-zA-Z0-9_.-]+$'. If the MCP service name contains non-ASCII characters (e.g., Chinese), this leads to an error:
Invalid 'tools[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\.-]+$'.
I would like to propose an enhancement to allow configuration of a specific 'functionName' for each MCP service in librechat.yaml. This 'functionName' would be used when passing tools to the model for Tool Calling. If 'functionName' is not explicitly set, it should default to the displayed service name (to maintain backward compatibility).
This feature would allow users to set a valid ASCII function name for Azure, while keeping the display name in any language.
More details
Steps to reproduce:
Invalid 'tools[0].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_\.-]+$'.
Workaround:
Currently, the only workaround is to avoid non-ASCII characters in the MCP service name, which limits the ability to localize or display user-friendly names in other languages.
Expected behavior:
Support an additional 'functionName' property for each MCP service in librechat.yaml. Use this functionName as the function's identifier during Tool Calls. If functionName is not set, fall back to the service name as before.
Example config:
Beta Was this translation helpful? Give feedback.
All reactions