Skip to main content
Glama

Statable Analytics

query_stats

Read-only

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']}].

TDQS

A4.4/5.0
Behavior4/5

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

Annotations provide readOnlyHint=true, and the description independently reaffirms this with 'read-only'. It adds meaningful context beyond annotations: timezone behavior, per-metric units, breakdown-only restrictions, event/goal semantics, and compare block structure. This gives an agent useful expectations without contradicting the annotation.

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 dense and front-loaded with the primary purpose. Every sentence adds operational detail, but it is a long single paragraph that packs many distinct behaviors together; clearer structural breaks would improve scannability. Still, nothing is wasted.

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 complex analytics tool without an output schema, the description covers the response shape, units for most metrics, timezone handling, filter encoding, and special event/goal behavior. Minor gaps remain: units for metrics like engagement_time, time_on_page, scroll_depth, and exit_rate are not explained, and no advice on pagination or very large results is given.

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?

Despite 71% schema description coverage, the description adds substantial meaning for parameters: date_range presets and custom pairs, compare's equal-length rule and block shapes, filters' round-trip code semantics, dynamic event:props dimensions, and units for multiple metrics. This goes well beyond what the raw schema alone communicates.

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 opens with a specific verb and resource: 'Run a read-only analytics query for one site', and immediately scopes the three output modes (aggregate totals, time series, top-N breakdown). This clearly distinguishes the tool from specialized siblings like current_visitors, top_countries, or visitors_over_time.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool: any analytics query for one site with aggregate, time-series, or breakdown needs. It explains key constraints like breakdown-only metrics and compare behavior, though it does not explicitly enumerate alternatives or when-not-to-use cases.

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.

TDQS

A3.7/5.0
Disambiguation4/5

Most tools map cleanly to distinct resources and actions: sites, goals, funnels, tracking settings, filters, and statistics. Some ambiguity exists between the generic query_stats and the many top_* / visitors_over_time convenience queries, but the descriptions mostly clarify when each should be used.

Naming Consistency3/5

The CRUD tools consistently use create_, get_, list_, and update_ prefixes, but a sizable minority deviate: top_* forms a separate pattern, and current_visitors, funnel_report, and visitors_over_time are noun-phrase names rather than verb_noun.

Tool Count3/5

25 tools sits at the heavy end for an analytics server. Many top_* tools overlap with what query_stats could do, making the count feel somewhat inflated, though the domain is broad enough that the number is not unreasonable.

Completeness3/5

The tool set covers site management, goals, funnels, tracking, filters, and statistics well. However, there are no delete operations for sites, goals, or funnels, leaving an obvious lifecycle gap and no way to clean up configured resources.

Resources