-
Couldn't load subscription status.
- Fork 1.2k
feat: first class MCP support for native tool calling #3212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 312a863 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
4520e9c to
691610d
Compare
|
Got it. Lemme try that one and see where the bug is. |
|
I got the error with OpenRouter and GPT-5 (other models also give errors, but generic ones). Prompt doesn't matter, "say hi" will do. |
OK, I think I know whats up here. The MCP server defines a parameter called 'type'. The OpenAI spec doesn't mention any restrictions or reserved words for the contents of the I'll need to think about how to handle this case. |
629f445 to
24721ba
Compare
…separator - Add helper functions to detect and parse dynamic MCP tool names - Normalize dynamic tools to standard 'use_mcp_tool' format - Use triple underscores (___) as separator to allow underscores in tool names - Update tool name generation in mcp_server.ts - Add comprehensive test coverage for dynamic tool parsing - Extract toolInputProps and convert to JSON string for MCP server compatibility
24721ba to
afeca17
Compare
|
I don't particularly love this renaming solution @chrarnoldus - it feels hacky, but I don't really have a better idea. Open to suggestions. I did confirm with qwen3-coder, haiku, GLM, and Sonnet 4.5, and with GH & Context7 MCPs |
|
I'll try to think of other solutions as well, thanks for your work |
|
I will say...it does work pretty reliable. |
|
Closing in favor of #3288 |



fixes #3229
Context
Implement dynamic MCP native tool generation support.
Available MCP servers are enumerated for their published tools, and dynamic tool definitions are generated
in the form of use_mcp_tool___servername___toolname.
Implementation
use_mcp_toolformattypetorenamed_typeinternally before sending to model, becausetypeis a reserved word for many parsers.Screenshots
How to Test
Use an MCP server with JSON calling enabled. Ensure that MCP servers can be called, and that they produce expected results.
Get in Touch
mcowger