Skip to main content
Glama
arttus

umami-mcp-server

by arttus

Get website traffic stats

umami_get_stats
Read-onlyIdempotent

Retrieve website traffic summaries for any date range, including pageviews, visitors, visits, and bounce rate. Optionally compare to the previous period to measure change.

Instructions

Get summary traffic statistics for a website over a date range, with optional comparison to the immediately preceding period.

This is the headline-numbers tool: pageviews, visitors, visits, bounce rate, and average visit duration. Bounce rate and average visit duration are derived here, since Umami returns raw bounce and total-time counts.

Args:

  • website (string, optional): Website ID, name, or domain.

  • range (string): Date range, default '7d'. Relative ('24h', '7d', '30d'), named ('today', 'yesterday', 'last_week', 'last_month', 'mtd', 'ytd'), or use start_date/end_date.

  • start_date / end_date (string, optional): Explicit bounds, overriding 'range'.

  • compare (boolean): Also return the previous period of equal length with percent change (default: true).

  • filters (object, optional): Segment filters such as { country: 'US', path: '/pricing' }.

  • timezone (string, optional): IANA timezone for day boundaries.

  • response_format ('markdown' | 'json'): Output format (default: 'markdown').

Returns: JSON shape: { "website_id": string, "range": { "start": string, "end": string }, "stats": { "pageviews": number, "visitors": number, "visits": number, "bounces": number, "totaltime": number, "bounce_rate_pct": number, "views_per_visit": number, "avg_visit_duration_seconds": number }, "previous": { ...same fields... } | null, "change": { "pageviews": string, "visitors": string, "visits": string, "bounce_rate_pct": string } | null }

Examples:

  • "How did the site do last month?" -> range="last_month"

  • "Traffic from mobile users in the US this week" -> range="this_week", filters={ device: "mobile", country: "US" }

  • "Compare this month to last" -> range="mtd", compare=true

Error handling:

  • Returns a 404 error if the website ID does not exist.

  • All-zero results usually mean the range predates tracking; check umami_get_website for the available data range.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeNoDate range for the query, default '7d'. Relative ("30m", "24h", "7d", "4w", "3mo", "1y"), named ("today", "yesterday", "this_week", "last_week", "this_month", "last_month", "this_year", "last_year", "mtd", "ytd", "all_time"), or an explicit ISO date via start_date/end_date.
compareNoInclude the previous period of equal length with percent change.
filtersNoOptional segment filters. Supported keys: path, referrer, title, query, browser, os, device, country, region, city, language, hostname, tag, event, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, segment, cohort. Example: { country: 'US', device: 'mobile' }.
websiteNoWebsite ID (UUID), name, or domain. Optional if UMAMI_DEFAULT_WEBSITE is set. Use umami_list_websites to discover values.
end_dateNoExplicit end date (YYYY-MM-DD, ISO 8601 timestamp, or epoch ms). Overrides 'range'.
timezoneNoIANA timezone for bucketing and day boundaries, e.g. 'America/New_York'. Defaults to UMAMI_TIMEZONE.
start_dateNoExplicit start date (YYYY-MM-DD, ISO 8601 timestamp, or epoch ms). Overrides 'range'.
response_formatNoOutput format: 'markdown' for a readable summary, 'json' for raw structured data.markdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds useful behavior beyond annotations: it discloses that bounce rate and avg duration are derived from raw counts, that compare defaults to true, that all-zero results usually mean the range predates tracking, and that a 404 is returned for a bad website ID. It could go further on pagination/timezone details, but this is solid.

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 organized into clear sections (summary, args, returns, examples, error handling) and is front-loaded with the key differentiator. It is somewhat long relative to the schema's completeness, but every section earns its place by adding behavioral or selection guidance rather than repeating schema text verbatim.

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 an 8-parameter tool with 100% schema coverage and no output schema, the description goes well beyond the minimum: it documents the return JSON shape, gives realistic examples, explains defaults, and covers error behavior. A fully complete definition might also enumerate sibling alternatives or disclose timezone defaults, but the gaps are minor given the rich schema.

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. The description adds meaningful semantics beyond the schema: it explains the meaning of 'range' values ('Relative... named... or use start_date/end_date'), clarifies the relationship between start_date/end_date and range (overriding), gives the default for compare and response_format, and provides a concrete filters example not fully enumerated in the schema's prose. The Args list is a useful summary even though it mirrors the schema closely.

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+resource ('Get summary traffic statistics for a website over a date range') and immediately distinguishes itself as the 'headline-numbers tool' with pageviews, visitors, visits, bounce rate, and average visit duration. It is clearly differentiated from sibling analytics tools like umami_get_pageviews_series, umami_get_metrics, and umami_get_active_visitors.

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?

Provides clear context on when to use the tool via the 'headline-numbers' framing, examples, and error-handling notes that point to umami_get_website for data-range concerns. It does not explicitly state when NOT to use this tool or list alternatives by name, so it loses a point, but the examples and scope are strong enough for an agent to select it correctly.

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