Skip to main content
Glama
luminarylane

GA4 MCP Server

by luminarylane

ga4_compare_periods

Compare Google Analytics 4 metrics between current and previous periods, displaying absolute values and percent change to reveal performance shifts.

Instructions

Compare current period vs previous period for key metrics. Shows absolute values and percentage change for each metric.

Args: property_id: GA4 property ID (numeric). Leave empty to use GA4_PROPERTY_ID env var. metrics: Comma-separated metrics to compare (default: sessions, users, pageviews, bounce rate, avg session duration, conversions). days: Period length in days (default: 28). Compares last N days vs the N days before that.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNo
metricsNosessions,totalUsers,screenPageViews,bounceRate,averageSessionDuration,conversions
property_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It explains the comparison logic, the period length default, and the env var fallback for property_id. It doesn't mention edge cases like timezone handling or empty property_id behavior, but the core behavior is well disclosed.

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 concise, front-loaded with the core purpose, and uses a clear Args block. Every sentence provides useful information without redundancy. It is well-structured for quick comprehension.

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?

The tool has three parameters, no annotations, but an output schema exists. The description covers the main behavior and all parameters, and given the output schema, no further detail on return values is necessary. It is complete enough for an agent to invoke the tool correctly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully document parameters. It does this excellently: property_id is numeric with an env var fallback, metrics is comma-separated with a default list, and days is explained with the 'last N vs N before' logic. This adds significant meaning beyond the raw schema.

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 uses a specific verb and resource: 'Compare current period vs previous period for key metrics.' It clearly differentiates from sibling tools like ga4_get_report or ga4_get_realtime by focusing on period-over-period comparison rather than single-period reports or realtime data.

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 intended use case is clear: comparing current and previous periods with a configurable period length. It explains the period logic ('last N days vs the N days before that') and provides defaults. It does not explicitly state when not to use it or mention alternatives, but the context is clear enough for an agent to select it appropriately.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luminarylane/ga4-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server