Skip to content

Integer Enum in MCP Schemas not accepted by ADK #2665

@yannrouillard

Description

@yannrouillard

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:

  1. Create a tool with a integer enum schema
  2. Load it as a tool using MCPToolset
  3. 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 botmcp[Component] Issues about MCP support

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions