Skip to main content
Glama

Get site totals

get_stats
Read-onlyIdempotent

Totals for one site over a period: visitors, pageviews, bounce rate (% of visits with one pageview), average visit duration (seconds of engaged time), average scroll depth (%) and average visible duration (seconds). Visitors over a range add up each day’s unique visitors, so a returning reader counts once for each day. Optionally filtered, e.g. filters ["country==DE"]. Every number is real, including small ones, filtered or not (suppressed is always false). A null metric means it was not measured. Report the range the result echoes. Costs ceil(days/7) units, ×(1 + filter dimensions) ×5 when filtered. A range can include history imported from another analytics tool: imported says whether these totals include it and for which days, and bounce rate and durations always cover Pulse-measured days only.

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": {
      "site_id": "<site_id>"
    },
    "name": "get_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day, inclusive, YYYY-MM-DD, in the site's timezone.
fromNoFirst day, YYYY-MM-DD, in the site's timezone. Use with to, instead of period, only for a range period cannot express. At most 366 days.
periodNo7d = today and the 6 days before it; 30d = today and the 29 days before it; month = this calendar month so far; year = this calendar year so far. All in the site's timezone. Use this rather than computing dates. Omit together with from/to for 7d.
filtersNoOptional filters, each dimension==value or dimension!=value, e.g. country==DE or page==/pricing. At most 2 distinct dimensions. Any filter multiplies the cost by 5.
site_idYesThe site's id, a UUID, from list_sites.

Output Schema

NameRequiredDescriptionDefault
rangeYes
filtersYes
site_idYes
importedNoPresent only when the range includes days imported from another analytics tool: whether these numbers include them (included), which days (from, through), the tool (source), and why they were left out (reason). Absent means no imported day is involved.
visitorsYes
pageviewsYes
suppressedYes
bounce_rateYes
avg_durationYes
min_cell_sizeYes
avg_scroll_depthYes
avg_visible_durationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description goes well beyond that, disclosing the cost formula (ceil(days/7) units, ×(1 + filter dimensions) ×5 when filtered), the no-suppression guarantee, null-means-unmeasured semantics, the per-day deduplication rule for visitors across a range, and how imported history is represented.

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 metric list and its definitions are front-loaded, and the cost, import and suppression notes follow in a logical order. It is dense and slightly run-on with heavy parenthetical definitions, but no sentence is filler for a metrics tool with this many caveats.

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?

An output schema exists, so return values need not be described; the description instead covers the things that schema cannot: cost, filtering effects, suppression policy, null semantics, and imported-data behavior. Nothing an agent needs in order to call this correctly and interpret the result appears 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 description coverage is 100%, so a baseline 3 is warranted, but the description adds real meaning: it clarifies that filters are dimension==value pairs and that filtering multiplies cost, and it explains the import caveat affecting which days the metrics cover. That is cost and semantics information the schema does not carry.

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?

The description opens with a specific resource and scope ("Totals for one site over a period") and enumerates exactly which metrics are returned, including inline definitions of bounce rate, average duration and scroll depth. That makes it distinguishable from get_breakdown and get_daily_series by shape of output, though it never names those siblings explicitly.

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?

Usage context is implied rather than stated: an agent can infer this is the aggregate-totals tool, and the filter example ("filters [\"country==DE\"]") shows a usage mode. However, there is no explicit when-to-use versus get_breakdown or get_daily_series, and no statement of when this tool should be avoided.

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.