Skip to content

fix: convert non-boolean additionalProperties to boolean in tool schemas#129

Open
lenanghai wants to merge 1 commit intogoogleanalytics:mainfrom
lenanghai:fix/additional-properties-schema
Open

fix: convert non-boolean additionalProperties to boolean in tool schemas#129
lenanghai wants to merge 1 commit intogoogleanalytics:mainfrom
lenanghai:fix/additional-properties-schema

Conversation

@lenanghai
Copy link
Copy Markdown

Summary

  • Fixes non-boolean additionalProperties in generated tool schemas that break MCP clients like Claude Desktop and OpenAI Codex
  • The ADK generates additionalProperties: {"type": "string"} for Dict[str, Any] type hints, but some clients expect a boolean value
  • Adds a recursive _fix_additional_properties() function in the existing schema post-processing step in coordinator.py

Root Cause

Parameters typed as Dict[str, Any] (e.g., date_ranges, dimension_filter, metric_filter, order_bys in run_report) produce JSON Schema with additionalProperties: {"type": "string"} instead of additionalProperties: true. This causes:

  • Claude Desktop: "No result received from client-side tool execution"
  • OpenAI Codex: Failed to convert MCP tool: invalid type: map, expected a boolean

Test plan

  • Verify run_report tool schema has additionalProperties: true (boolean) instead of {"type": "string"}
  • Verify Claude Desktop can successfully call run_report
  • Verify OpenAI Codex can discover and use run_report

Fixes #40

🤖 Generated with Claude Code

Some MCP clients (Claude Desktop, OpenAI Codex) expect
additionalProperties to be a boolean, not a JSON Schema object.
The ADK generates `additionalProperties: {"type": "string"}` for
Dict[str, Any] type hints, which causes these clients to fail
silently or reject the tool schema entirely.

This adds a recursive fix in the schema post-processing step that
converts any non-boolean additionalProperties to `true`.

Fixes googleanalytics#40

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 30, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@matt-landers
Copy link
Copy Markdown
Member

@lenanghai Thanks for your submission.

Can you sign the CLA here: https://cla.developers.google.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data API Functions Fail with Claude Desktop

3 participants