Skip to main content
Glama
key-arg

Statable Analytics

query_stats

Run read-only analytics queries to retrieve aggregate totals, time series, or top-N breakdowns for a site's visitors, pages, sources, and goals.

Instructions

Run a read-only analytics query for one site: aggregate totals, a time series, or a top-N breakdown. Returns {"results":[{"dimensions":{...omitted for aggregates},"metrics":{...}}]}. All dates and time buckets are in the site's own timezone (see list_sites .timezone). The event:name breakdown lists custom events (data-statable-event); its events metric is the raw event count. The event:goal breakdown lists the site's configured goals with visitors (converters), events (conversions) and conversion_rate (percent). events/conversion_rate are breakdown-only (rejected on aggregate/time-series or a dimension that doesn't compute them). Units: visit_duration = average seconds per visit; bounce_rate = percent 0-100; views_per_visit = pageviews/visits ratio; visitors/pageviews/visits = counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteNoNumeric site_id (preferred, from list_sites) or a domain, e.g. example.com — scheme, www. and path are ignored when matching. If several sites share the domain the call fails and lists their site_ids. Omit for a single-site key.
limitNoBreakdown only. Default 100, max 1000.
compareNo"previous_period" (equal-length window before date_range) or a custom ["YYYY-MM-DD","YYYY-MM-DD"] pair. Adds a compare {value, change%} block: per-metric (aggregate), per-row (breakdown; not event:status_code/event:goal), or per-bucket (time-series). Time-series needs an equal-length range (else compare_length_mismatch).
filtersNo
metricsYes
date_rangeYesPreset "7d" or "30d" (last N full days), "month" (current calendar month to date; the first bucket may land on the prior month's last day), "realtime" (last ~30 min — pair with the time:minute dimension), "Nd" for the last N days (1..90, e.g. "14d"), or a custom inclusive ["YYYY-MM-DD","YYYY-MM-DD"] pair (over 90 days use a custom pair).
dimensionsNoZero = aggregate; one time dimension (time, time:hour, time:day, time:week, time:month) = time series; one breakdown dimension = top-N. Besides the enum you may also pass a dynamic 'event:props:<key>' dimension to break a custom event down by one of its property values (metrics visitors + events) — it REQUIRES an 'event' filter to name the event, e.g. dimensions:['event:props:plan'] + filters:[{field:'event',operator:'is',values:['Signup']}].

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations available, the description carries the full burden and does so thoroughly. It discloses read-only semantics, site-local timezone behavior, the meaning of event:name and event:goal breakdowns, breakdown-only metrics that get rejected in other modes, metric units, comparison behaviors, and dynamic event:props requirements.

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 long, but the tool is complex with seven parameters and rich behavior. It is well structured: core purpose first, then return shape, timezone, breakdown semantics, metric restrictions, units, and dynamic dimensions. Each clause adds necessary information rather than repeating schema content.

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?

For a complex query tool with no output schema, the description is remarkably complete. It covers return shape via an example, timezone handling, metric meanings and units, breakdown-only restrictions, compare range requirements, ambiguous-site failure behavior, and the dynamic dimension pattern. An agent has enough context 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?

Though the schema already has roughly 71% coverage, the description adds substantial meaning beyond the enums: exact unit definitions for visit_duration, bounce_rate, views_per_visit, and counts; explanation of event:goal metrics; restrictions on when events/conversion_rate are valid; and the dynamic event:props dimension pattern. This meaningfully clarifies how parameter values behave.

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 verb and resource: 'Run a read-only analytics query for one site' and names the three supported shapes (aggregate totals, time series, top-N breakdown). It is clear, but it does not explicitly differentiate itself from sibling tools like top_pages or top_sources, which are specialized versions of the same kind of query.

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?

The usage context is clear: use this for one-site analytics queries needing aggregate, time-series, or top-N results. However, no alternatives are named and there is no explicit guidance about when to prefer query_stats over the sibling top_* or visitors_over_time tools; usage is implied rather than stated.

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

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/key-arg/statable-mcp'

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