Skip to main content
Glama

Query analytics totals and breakdowns

websiteAnalytics_query_get
Read-onlyIdempotent

Returns aggregate engagement totals — page views, distinct visitors, visits, bounces, and total time in seconds — for a date range, optionally broken down by one dimension. Use it to answer "how much traffic did the site get" and "what are the top pages/referrers/countries" style questions; use the timeseries endpoint when you need values over time instead. startAt and endAt are Unix epoch milliseconds; optional filter parameters (path, referrer, country, event, UTM fields, ...) narrow the data. Without dimension the response carries the totals alone. With dimension (e.g. path for top pages, referrer for top referrers, country for top countries) the response also carries rows: up to limit (default 25, max 1000) values of that dimension ranked by page views, each with its own engagement totals. Requires a plan that includes analytics (403 otherwise); all-zero totals until the website is published and has traffic.

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": {
      "websiteId": "<websiteId>",
      "startAt": "<startAt>",
      "endAt": "<endAt>"
    },
    "name": "websiteAnalytics_query_get"
  }
}

Input Schema

NameRequiredDescriptionDefault
osNo
tagNo
cityNo
pathNo
endAtYes
eventNo
limitNoMaximum number of dimension rows to return (default 25, max 1000). Only used when `dimension` is set.
queryNo
titleNo
cohortNo
deviceNo
regionNo
browserNo
countryNo
segmentNo
startAtYes
utmTermNo
hostnameNo
languageNo
referrerNo
dimensionNoBreak the range down by this dimension, e.g. `path` for top pages, `referrer` for top referrers, `country` for top countries. Omit for totals only.
utmMediumNo
utmSourceNo
websiteIdYes
distinctIdNo
utmContentNo
utmCampaignNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/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), so the description wisely spends its budget on non-annotation behavior: plan-gated 403, empty results until the site is published and has traffic, ranking order by page views, and the row cap. These are exactly the failure modes an agent would otherwise misread as 'no data'.

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 the totals-vs-dimension response shape, then constraints — a sensible order. It is dense and nearly every clause earns its place, though the long run-on filter list ('path, referrer, country, event, UTM fields, ...') is the one place that could be tightened.

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, yet the description still specifies the return shape: totals alone without dimension, and totals plus `rows` (ranked dimension values with their own engagement totals) when dimension is set. For a 27-parameter analytics query, that covers what an agent needs to call it and interpret the result correctly.

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?

With only 7% schema description coverage, the description carries the burden and does the high-value parts: startAt/endAt are Unix epoch milliseconds (undocumented in schema), dimension examples map enum values to intents, and limit's default/max is restated contextually. It falls short on the ~15 filter parameters, covering path/referrer/country/event/UTM but leaving cohort, segment, distinctId, channel, screen and hostname semantics unexplained.

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 — 'Returns aggregate engagement totals' with the exact metrics enumerated — plus optional one-dimension breakdown. It names the sibling it is not (the timeseries endpoint) so an agent can separate this from websiteAnalytics_timeseries_get without opening a 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?

Explicitly maps questions to the tool ('how much traffic did the site get', 'top pages/referrers/countries') and gives the exclusion with the alternative: 'use the timeseries endpoint when you need values over time instead.' It also states prerequisites/edge conditions (403 without an analytics plan, all-zero totals before publish).

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