Skip to main content
Glama
Google Analytics MCP Server

Google Analytics MCP Server

run_comparison_report

Read-only

Compares two GA4 periods using the same report fields and filters, returning labeled baseline and comparison rows for analysis.

Instructions

Compare two periods with identical report fields and filters.

Args: property_id: Numeric property ID or properties/ID. report: ReportSpec without date_ranges. Shared dimensions, metrics, filters, order_bys, limit and offset are applied to both periods. baseline_date_range: DateRange with start_date and end_date; inclusive. comparison_date_range: DateRange for the period being compared.

Returns: Labeled baseline and comparison reports from one batch request. Match rows by dimension values, not row position. Limits apply separately; missing rows are not zeros. No summing rates or distinct-user counts.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "property_id": "<property_id>",
      "report": "<report>",
      "baseline_date_range": "<baseline_date_range>",
      "comparison_date_range": "<comparison_date_range>"
    },
    "name": "run_comparison_report"
  }
}

Input Schema

NameRequiredDescriptionDefault
reportYesA single core report; field names use Data API snake_case.
property_idYesNumeric GA4 property ID or properties/ID; metadata property 0 is universal
baseline_date_rangeYesAn inclusive GA4 date range in the property's timezone.
comparison_date_rangeYesAn inclusive GA4 date range in the property's timezone.

Output Schema

NameRequiredDescriptionDefault
baselineYes
comparisonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, non-destructive, open-world, so the safety profile is covered. The description still adds useful behavior beyond that: a single batch request backs both periods, limits apply separately per period, missing rows are not zeros, and rates or distinct-user counts must not be summed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then Args and Returns sections that map cleanly to the call. Some of the Args text restates schema titles and descriptions, but it is short and each Returns sentence (row matching, separate limits, no summing rates) carries real information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Four required parameters, nested ReportSpec and DateRange objects, full schema coverage, annotations, and an output schema are all accounted for. The description still supplies the non-obvious analysis caveats (row alignment by dimension values, per-period limits, non-additive metrics) an agent needs to use results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: report must be a ReportSpec without date_ranges, its dimensions/metrics/filters/order_bys/limit/offset are applied to both periods, and both date ranges are inclusive. That constraint on the report argument is not stated in the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: compare two periods using identical report fields and filters, returning labeled baseline and comparison reports from one batch request. This is clearly distinguishable from a single-period report tool, though no sibling (e.g. run_report) is named explicitly to route the agent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the agent learns the report spec must omit date_ranges and that shared dimensions/metrics/filters apply to both periods, and that rows must be matched by dimension values rather than position. There is no explicit when-to-use or when-not-to-use guidance versus run_report or batch_run_reports.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.