-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botmcp[Component] Issues about MCP support[Component] Issues about MCP support
Description
Describe the bug
When a MCP tool has an integer enum in its parameter, it causes Google ADK to fail with an error message similar to this one when loading the tool:
2025-08-21 18:38:58,923 - ERROR - adk_web_server.py:857 - Error in event_generator: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': "Invalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[0]' (TYPE_STRING), 7\nInvalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[1]' (TYPE_STRING), 10\nInvalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[2]' (TYPE_STRING), 12\nInvalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[3]' (TYPE_STRING), 15\nInvalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[4]' (TYPE_STRING), 20\nInvalid value at 'tools[0].function_declarations[0].parameters.properties[8].value.any_of[0].enum[5]' (TYPE_STRING), 30[...]
It is often preceded by this warning: PydanticSerializationUnexpectedValue(Expected
str - serialized value may not be as expected [input_value=30, input_type=int])
To Reproduce
Steps to reproduce the behavior:
- Create a tool with a integer enum schema
- Load it as a tool using
MCPToolset
- See the error
Expected behavior
Loading and using the MCP tool properly
Metadata
Metadata
Assignees
Labels
bot triaged[Bot] This issue is triaged by ADK bot[Bot] This issue is triaged by ADK botmcp[Component] Issues about MCP support[Component] Issues about MCP support