Skip to main content
Glama

Query traffic over time

query_timeseries
Read-onlyIdempotent

Daily pageviews and unique visitors for one landing page, optionally split by a dimension (device type, country, referrer, page path, UTM source/medium/campaign) and filtered to one device or country.

Use when the user asks how traffic moved day by day, or which device, country, or source drove a change. For a one-call overview use get_analytics_summary; for period-over-period comparison use get_analytics_detail. Each row has date, dimensionValue ("all" when no dimension is set), pageviews, and visitors. Visitors are unique per day, so don't add them up across days. Data covers the last 3 months and excludes known bots and vulnerability scanners, the same as get_analytics_summary. Read-only: it changes no page, setting, or analytics data. The data it scans counts toward the workspace's monthly analytics reads, as the dashboard's analytics do, and nothing is billed for it. 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 filters are device (mobile, desktop, tablet) and country (two-letter code such as JP or US).

Combine results with detect_trend to confirm trends.

Examples:

  • Basic traffic: query_timeseries(siteId, "2026-09-01", "2026-09-28")

  • By device: query_timeseries(siteId, "2026-09-01", "2026-09-28", dimension="device")

  • By UTM source: query_timeseries(siteId, "2026-09-01", "2026-09-28", dimension="utm_source")

  • Mobile only: query_timeseries(siteId, "2026-09-01", "2026-09-28", filters={device:"mobile"})

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "siteId": "<siteId>",
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    },
    "name": "query_timeseries"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum rows to return. Defaults to 100, max 500.
siteIdYesThe ID of the page to query
endDateYesEnd date (YYYY-MM-DD)
filtersNoOptional filters to narrow results. Supported keys: device, country
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.
dimensionNoOptional dimension to break down results by
startDateYesStart date (YYYY-MM-DD)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changed
    • changedInput schema / properties / siteId / description
      Previous value: -"The site ID to query"New value: +"The ID of the page to query"
  3. 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"
      +}
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world, yet the description still adds real value: a 3-month data window, bot/scanner exclusion, quota consumption against monthly analytics reads, and the warning that visitors are unique per day and must not be summed. The timezone section discloses partial-day rows for today and a timeZonePending state, which annotations cannot express. Minor cost: 'Read-only: it changes no page, setting, or analytics data' merely restates readOnlyHint.

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-loaded with purpose, then usage routing, then row shape, caveats, and worked examples, so an agent skimming the first sentence already knows the tool. The timezone paragraph is the longest block and is dense but justified by non-obvious semantics; the one genuinely redundant sentence is the restatement of readOnlyHint.

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?

No output schema exists, and the description compensates by describing each returned row field (date, dimensionValue with its 'all' sentinel, pageviews, visitors) plus the timeZone and timeZoneSource response fields. Combined with quota, coverage window, bot exclusion, and date rules, nothing an agent needs to call this correctly is missing.

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 100%, so the baseline is 3, and the description earns a step up by supplying meaning the schema lacks: allowed filter values (device: mobile/desktop/tablet; country: two-letter code such as JP or US) where the nested filter schema declares bare strings, valid-calendar-date and startDate<=endDate validation, and that timeZone changes only the response. The limit parameter is not discussed in the description, though the schema fully documents it.

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?

States a specific verb and resource (daily pageviews and unique visitors for one landing page) plus the two optional axes: dimension breakdown and device/country filtering. It enumerates concrete dimension values, letting an agent distinguish it from get_analytics_summary and get_analytics_detail without opening any schema.

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?

Gives explicit use conditions ('how traffic moved day by day, or which device, country, or source drove a change') and names the two alternatives with the condition that selects each (one-call overview vs period-over-period comparison). It also routes to detect_trend for confirmation, so when-not guidance is present, not just when.

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.