-
Notifications
You must be signed in to change notification settings - Fork 6.6k
fix: transform MCP tool schemas for Google/Gemini compatibility #4538
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
fix: transform MCP tool schemas for Google/Gemini compatibility #4538
Conversation
- Apply ProviderTransform.schema() to MCP tools to convert integer enums to strings - Convert function declaration to arrow function for strict mode compliance - Fix variable shadowing in content iteration loop Resolves 'Invalid value at tools.function_declarations' error when using Google/Gemini with MCP tools that have integer enum parameters.
f1dc981 to
3e15a39
Compare
df8bdf9 to
0dd5039
Compare
|
We need this but I tested with several providers and this does not work correctly. Your changes will basically delete the input schema entirely I'd recommend not using type error silencing because it is going to make code harder to maintain. |
|
Fixed. I have tested it with grok, anthropic, gemini etc. |
|
This looks good ill test more tmr just to be sure. We used to sanitize the tools way better before we did the zodv4 migration and then we kinda just forgot about it ig: |
Resolves 'Invalid value at tools.function_declarations' error when using
Google/Gemini with MCP tools that have integer enum parameters.
Closes: #4512