Skip to main content
Glama
MoonEyes

google-ecommerce-mcp

GA4 compare

ga4_compare
Read-onlyIdempotent

Compare a GA4 period with an earlier one in ONE call (Data API runReport with two date ranges): this month against last month, the last 7 days against the 7 before, a month against the same month last year.

Instructions

Compare a GA4 period with an earlier one in ONE call (Data API runReport with two date ranges): this month against last month, the last 7 days against the 7 before, a month against the same month last year. Returns, per row, the current and previous value of each metric with the absolute "change" and "change_pct" (percent; None when the previous value is 0), "totals" over every row, the unit and definition of each metric under "metrics", the currency, both "date_range"s resolved to calendar dates in the property's timezone with "data_complete", and "biggest_moves": the 5 rows whose first metric changed the most in absolute terms. A key present in one range only shows the other as 0 and a "present_in" list. Use ga4_report for a single range.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows returned (1 to 1000); totals and biggest_moves always cover every fetched row
periodNolast_7_days, last_14_days, last_28_days, last_30_days, last_90_days, this_month (month to date, up to yesterday), last_month (whole previous month) or YYYY-MM-DD:YYYY-MM-DDlast_28_days
metricsNoGA4 API metric names, e.g. sessions, purchaseRevenue, ecommercePurchases; the first one ranks biggest_moves
client_idNoClient id from clients_list. Required when several clients are registered; empty uses the only client (or the environment variables when there is no client registry)
compare_toNoprevious_period: the range of the same length just before (this_month is set against the same number of days of the month before); previous_year: the same dates one year earlierprevious_period
dimensionsNoGA4 API dimension names that split the rows, e.g. sessionDefaultChannelGroup, landingPage, itemName; empty list for one row of totals
property_idNoNumeric GA4 property id, as listed by ga4_properties; empty uses the configured GA4_PROPERTY_ID (or the client's property)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint, non-destructive), the description discloses important runtime behavior: per-row current/previous values, change and change_pct with None for zero previous values, totals, metric metadata, resolved date ranges with data_complete, and biggest_moves. It also explains the edge case where a key exists in only one range by showing the other as 0 plus present_in.

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

Conciseness5/5

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

The definition is front-loaded with the core comparison purpose and examples, then moves efficiently into return structure and edge cases. Despite its density, every sentence contributes useful information and there is no redundant restatement of the tool name or title.

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?

There is no output schema, so the description carries the burden of explaining return values—and it does so thoroughly: per-row values, change metrics, totals, metric metadata, currency, resolved date ranges, data completeness, and biggest_moves. Combined with a fully documented parameter schema, an agent has everything needed to call and interpret the tool.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already documents every parameter with defaults, enums, and examples. The description adds output semantics tied to parameters (e.g., first metric ranks biggest_moves, date ranges resolved in property timezone), but parameter guidance itself is largely carried by the schema, so the baseline 3 is appropriate.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Compare a GA4 period with an earlier one in ONE call (Data API runReport with two date ranges)', and immediately distinguishes the tool from ga4_report by directing single-range queries elsewhere.

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

Usage Guidelines5/5

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

It gives concrete usage examples ('this month against last month, the last 7 days against the 7 before, a month against the same month last year') and explicitly names the alternative tool for the single-range case: 'Use ga4_report for a single range.'

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

Deploy Server

Other Tools