Skip to main content
Glama

AddSynapse Analytics

Compare two periods

ga_compare_periods
Read-onlyIdempotent

Compares two periods in Google Analytics 4 (default: the last 7 full days vs the 7 days before) — sessions, users, purchases, revenue and conversion rate, with the change in % — and, with dimension, which channels/campaigns/pages caused the change. Use it for «why did sales drop this week: less traffic or worse conversion?».

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ga_compare_periods"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
end_dateNoYYYY-MM-DD, or today / yesterday / NdaysAgo (e.g. 28daysAgo).yesterday
dimensionNoOptional breakdown, e.g. sessionDefaultChannelGroup, sessionCampaignName, landingPage, deviceCategory.
start_dateNoYYYY-MM-DD, or today / yesterday / NdaysAgo (e.g. 28daysAgo).7daysAgo
property_idNoGA4 property id (digits, from ga_list_properties). Optional when the account has only one property.
compare_end_dateNoYYYY-MM-DD, or today / yesterday / NdaysAgo (e.g. 28daysAgo).8daysAgo
compare_start_dateNoYYYY-MM-DD, or today / yesterday / NdaysAgo (e.g. 28daysAgo).14daysAgo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds real value beyond that by disclosing the default comparison window (last 7 full days vs the prior 7) and the shape of the result (metrics plus % change, optionally broken down by dimension). It does not mention pagination behavior, limits on returned rows, or error conditions, so it remains partial.

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-loads the verb and the two core metrics of the operation, then adds the optional breakdown and a one-line motivating use case. The em-dash-heavy single sentence is dense but every clause carries information. Slightly long, but no filler or repetition.

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

Completeness4/5

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

With 7 optional parameters, no required inputs, and no output schema, this is a moderately complex tool, and the description covers the default window, the metrics returned, and the effect of the dimension parameter. It does not spell out the result structure per dimension (rows, ordering, row limit behavior), which would be helpful absent an output schema, but nothing essential for a correct call is missing.

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 86%, so the schema already carries the parameter burden, and the baseline is 3. The description reinforces the default date window consistent with the schema defaults and clarifies that `dimension` serves to attribute the change to channels/campaigns/pages, which is meaning beyond the schema's terse example list. It says nothing about `limit` or how property_id resolution works when omitted, so it does not fully compensate.

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?

Specific verb plus resource: 'Compares two periods in Google Analytics 4', enumerating the metrics (sessions, users, purchases, revenue, conversion rate) and the % change, and noting the optional dimension breakdown of which channels/campaigns/pages drove the change. An agent can distinguish this from a plain report call. It stops short of naming the closest sibling (ga_report) as the alternative, so the distinguishing statement is implicit rather than explicit.

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?

Clear usage context is supplied via the concrete question 'why did sales drop this week: less traffic or worse conversion?', which tells the agent this is a diagnostic comparison tool rather than a raw data pull. It also states the condition for using the `dimension` parameter. No explicit exclusions or named alternative tools are given, so it is clear context without full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources