Skip to content

fix: improve MCP schema compatibility and LLM guidance for reporting tools#135

Merged
matt-landers merged 3 commits intomainfrom
fix-mcp-schema
Apr 8, 2026
Merged

fix: improve MCP schema compatibility and LLM guidance for reporting tools#135
matt-landers merged 3 commits intomainfrom
fix-mcp-schema

Conversation

@matt-landers
Copy link
Copy Markdown
Member

This PR addresses two main issues with the Google Analytics MCP server:

  1. Client Compatibility: Some MCP clients (e.g., Claude Desktop) expect additionalProperties in the tool input schema to be a boolean value rather than an object. I've added a recursive sanitize_mcp_schema_properties function to ensure all additionalProperties fields are converted to booleans.
  2. LLM Guidance: To improve the reliability of tool calling for the run_report and run_realtime_report tools, I've explicitly marked essential fields as required in their schemas. This helps LLMs correctly identify the necessary arguments when generating tool calls.

Changes:

  • Added sanitize_mcp_schema_properties utility to analytics_mcp/coordinator.py.
  • Applied schema sanitization to all MCP tools.
  • Explicitly defined required fields for run_report and run_realtime_report tools.

@matt-landers matt-landers requested a review from jradcliff April 8, 2026 16:07
@matt-landers matt-landers merged commit 21c0599 into main Apr 8, 2026
8 checks passed
@matt-landers matt-landers deleted the fix-mcp-schema branch April 8, 2026 17:18
Copy link
Copy Markdown

@emwhipple30-svg emwhipple30-svg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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.

3 participants