Skip to main content
Glama

GA4 period comparison

ga_compare_periods
Read-onlyIdempotent

Compare GA4 metrics for current and previous periods by dimension, including per-row and total deltas and percent changes, to see how traffic changed versus last month.

Instructions

Compare GA4 metrics between a current and a previous period, broken down by dimensions (default: channel group). Returns per-row current/previous/delta/percent change plus period totals. Use it for 'how did organic traffic change vs last month'.

Input Schema

NameRequiredDescriptionDefault
limitNoRows returned (sorted by absolute change of the first metric).
metricsNo
currentEndNoyesterday
dimensionsNo
propertyIdYesGA4 property ID, e.g. '123456789' (see ga_list_properties).
filterLogicNoHow to join several dimensionFilters.and
previousEndNo29daysAgo
currentStartNo28daysAgo
metricFiltersNoAND-ed metric filters (post-aggregation).
previousStartNo56daysAgo
dimensionFilterNoRaw FilterExpression; overrides dimensionFilters.
dimensionFiltersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, covering the safety profile. The description adds value by explaining the return structure (per-row current/previous/delta/percent change plus period totals), but it does not mention pagination, rate limits, or any other behavioral quirks. It provides some additional context beyond the annotations, but not a rich behavioral picture.

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 description is two sentences with no fluff. It front-loads the main action, states the output, and gives a concrete example. Every sentence earns its place, and the structure is efficient and clear.

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

Completeness2/5

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

Given the complexity (12 parameters, no output schema), the description is incomplete. It does not explain how to set date ranges, what metrics are valid, how filters work, or provide a detailed output format beyond a summary. The lack of an output schema and the minimal parameter guidance leaves significant gaps for an agent attempting to call this tool correctly.

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

Parameters2/5

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

Schema description coverage is only 42%, so the description should compensate for undocumented parameters. It only mentions the dimensions default (channel group) and does not explain date range parameters (currentStart, previousStart, etc.), metrics, or filter options. The schema provides some descriptions for limit, propertyId, filterLogic, and filters, but the description adds almost nothing beyond that. The low coverage and lack of description compensation make this a weak area.

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 clearly states a specific action (compare GA4 metrics) with a specific resource (between periods) and describes the output (per-row changes and totals). It distinguishes itself from general GA4 reporting tools by focusing on period-over-period comparison, and it gives a concrete use case. It is not a tautology and provides enough specificity to be unique among siblings.

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

Usage Guidelines4/5

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

The description provides a clear example of when to use the tool ('how did organic traffic change vs last month'), which implies a period-over-period comparison scenario. However, it does not explicitly mention when not to use it or name alternative tools (e.g., ga_run_report for single-period reports). The guidance is clear but could be more explicit about exclusions.

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