Skip to content

feat: add tool for new conversions schema and spec#161

Merged
matt-landers merged 5 commits into
mainfrom
feat-conversions
May 14, 2026
Merged

feat: add tool for new conversions schema and spec#161
matt-landers merged 5 commits into
mainfrom
feat-conversions

Conversation

@matt-landers
Copy link
Copy Markdown
Member

Description

This PR implements the new Conversions Reporting functionality for the Google Analytics MCP server, allowing users to query conversion-specific metrics, ad performance, and attribution data using the Google Analytics Data API.

Key Changes

  • Library Upgrade: Updated google-analytics-data to version 0.22.0 in pyproject.toml to support the conversion_spec field in RunReportRequest.
  • New Tool Implementation: Created analytics_mcp/tools/reporting/conversions.py containing the run_conversions_report function.
    • Utilizes the v1alpha client's run_report method.
    • Explicitly maps the conversion_spec parameter (including conversion_actions and attribution_model).
  • Enhanced LLM Guidance:
    • Added a "WHEN TO USE" section to the tool's docstring to help LLM agents distinguish between standard reports and conversion reports.
    • Explicitly listed all 12 allowed camelCase dimensions and 12 allowed camelCase metrics directly in the tool description to minimize errors during tool calling.
    • Provided clear examples for conversion_spec structure and attribution models.
  • Server Registration: Registered the new tool in analytics_mcp/coordinator.py and marked mandatory fields (property_id, date_ranges, dimensions, metrics, conversion_spec) in the MCP
    schema.

@matt-landers matt-landers requested a review from jradcliff May 14, 2026 12:56
Comment thread analytics_mcp/tools/reporting/conversions.py Outdated
Co-authored-by: Josh Radcliff <jradcliff@users.noreply.github.com>
@matt-landers matt-landers merged commit 02d9ac1 into main May 14, 2026
8 checks passed
@matt-landers matt-landers deleted the feat-conversions branch May 14, 2026 14:59
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.

2 participants