Skip to main content
Glama

Compare segments

query_segments
Read-onlyIdempotent

Compare two visitor segments side-by-side with daily time series.

Define two segments with different filters (e.g., mobile vs desktop, Japan vs US) and get parallel daily pageview/visitor data for each. Data covers the last 3 months and excludes known bots and vulnerability scanners, the same as get_analytics_summary. Scans count toward the monthly analytics scan quota and overage billing where applicable. Dates must be valid calendar dates in YYYY-MM-DD format, and startDate must be on or before endDate. Dates are days in the workspace's time zone, UTC when the workspace has none set, and startDate and endDate are whole days in the zone used. Pass timeZone, an IANA name such as America/New_York, for days in another zone; it changes only this response, never the workspace's time zone. The result's timeZone field names the zone used, and timeZoneSource says where it came from (argument, workspace, or default). A row for today's date in that zone counts only the hours so far. When timeZonePending is set, the workspace is switching to that zone once its history is recomputed. Supported segment filters are device (mobile, desktop, tablet) and country (two-letter code such as JP or US).

Example: segmentA={label:"Mobile", filters:{device:"mobile"}}, segmentB={label:"Desktop", filters:{device:"desktop"}}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows to return per segment. Defaults to 100, max 500.
siteIdYesThe ID of the page
endDateYesEnd date (YYYY-MM-DD)
segmentAYes
segmentBYes
timeZoneNoIANA time zone name for the days in this response, such as America/New_York, Europe/Berlin, or Asia/Tokyo. Leave it out for the workspace's time zone (UTC when none is set). It affects only this response: the workspace's time zone stays as it is, and only the workspace's owner changes it, in the dashboard's Settings. Abbreviations such as EST and offsets such as +09:00 aren't accepted.
startDateYesStart date (YYYY-MM-DD)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / siteId / description
      Previous value: -"The site ID"New value: +"The ID of the page"
  2. Changed1 schema field changed
    • addedInput schema / properties / timeZone
      Added value: +{
      +  "description": "IANA time zone name for the days in this response, such as America/New_York, Europe/Berlin, or Asia/Tokyo. Leave it out for the workspace's time zone (UTC when none is set). It affects only this response: the workspace's time zone stays as it is, and only the workspace's owner changes it, in the dashboard's Settings. Abbreviations such as EST and offsets such as +09:00 aren't accepted.",
      +  "maxLength": 64,
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial context beyond them: 3-month data window, bot/scanner exclusion, scan quota and overage billing, time-zone day semantics, partial-day handling, and timeZonePending behavior.

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?

The description is front-loaded and logically organized into purpose, data scope, date handling, and filter details. It is somewhat long and repeats some timeZone details already present in the schema, but every section contributes useful context.

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?

For a tool with seven parameters, nested segment objects, and no output schema, the description covers the critical operational details: segment filter semantics, date/time-zone rules, data scope, and quota implications. It could be slightly more complete by mentioning the limit parameter, but the schema covers that adequately.

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 71%, so the schema carries most parameter meaning, but the description adds value: it clarifies date format constraints, startDate <= endDate, time-zone handling for whole days, supported segment filters (device, country), and provides a nested example. It does not explain the limit parameter, which is left to the 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 immediately states a specific verb and resource: compare two visitor segments side-by-side with daily time series. It gives a concrete example and mentions the data scope, making it easy to distinguish from siblings like get_analytics_summary or query_timeseries.

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?

It explains how to define segments and gives examples, but never states when to use this tool instead of query_timeseries, get_analytics_summary, or get_analytics_detail. The overlap with get_analytics_summary is mentioned for data coverage, not as an alternative, so the usage guidance is implied rather than explicit.

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.