responseMimeType.application/json is incompatible with function-calling modes in ADK agent config
🔴 Required Information
Describe the Bug:
ADK Agent Config accepts a configuration where responseMimeType is set to application/json while tools are enabled and functionCallingConfig.mode is set to AUTO or ANY . Although responseMimeType: application/json is documented as a supported option, this configuration causes the Gemini backend to reject the request with a 400 INVALID_ARGUMENT error.
However, when functionCallingConfig.mode is set to NONE, the agent runs successfully and produces the expected output.
Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
- Install
google-adk.
- Create an ADK Agent Config with tools enabled.
- Set
generate_content_config.responseMimeType to application/json.
- Set
generate_content_config.toolConfig.functionCallingConfig.mode to AUTO.
- Run the agent with
gemini-2.5-pro.
- Observe that the request fails with
400 INVALID_ARGUMENT error.
Expected Behavior:
A clear and concise description of what you expected to happen.
- Reject this incompatible configuration during configuration loading
- Clearly document this limitation in the ADK Agent Config documentation.
Observed Behavior:
error message
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': "Function calling with a response mime type: 'application/json' is unsupported", 'status': 'INVALID_ARGUMENT'}}
Environment Details:
- ADK Library Version (pip show google-adk): 1.33.0
- Desktop OS:** [e.g., macOS, Linux, Windows] Windows
- Python Version (python -V): 3.11.15
Model Information:
- Are you using LiteLLM: No
- Which model is being used: (e.g., gemini-2.5-pro) gemini-2.5-pro
🟡 Optional Information
Providing this information greatly speeds up the resolution process.
Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': "Function calling with a response mime type: 'application/json' is unsupported", 'status': 'INVALID_ARGUMENT'}}
Screenshots / Video:
If applicable, add screenshots or screen recordings to help explain
your problem.
Additional Context:
Minimal Reproduction Code:
agent config root_agent.yaml
generate_content_config:
temperature: 0.1
maxOutputTokens: 4000
responseMimeType: application/json
toolConfig:
functionCallingConfig:
mode: AUTO
How often has this issue occurred?:
responseMimeType.application/json is incompatible with function-calling modes in ADK agent config
🔴 Required Information
Describe the Bug:
ADK Agent Config accepts a configuration where
responseMimeTypeis set toapplication/jsonwhile tools are enabled andfunctionCallingConfig.modeis set toAUTOorANY. AlthoughresponseMimeType: application/jsonis documented as a supported option, this configuration causes the Gemini backend to reject the request with a400 INVALID_ARGUMENTerror.However, when
functionCallingConfig.modeis set toNONE, the agent runs successfully and produces the expected output.Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:
google-adk.generate_content_config.responseMimeTypetoapplication/json.generate_content_config.toolConfig.functionCallingConfig.modetoAUTO.gemini-2.5-pro.400 INVALID_ARGUMENTerror.Expected Behavior:
A clear and concise description of what you expected to happen.
Observed Behavior:
error message
Environment Details:
Model Information:
🟡 Optional Information
Providing this information greatly speeds up the resolution process.
Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.
Screenshots / Video:
If applicable, add screenshots or screen recordings to help explain
your problem.
Additional Context:
Minimal Reproduction Code:
agent config root_agent.yaml
How often has this issue occurred?: