Skip to main content
Glama
arttus

umami-mcp-server

by arttus

Get ranked traffic breakdown

umami_get_metrics
Read-onlyIdempotent

Break down traffic by pages, referrers, countries, devices, channels, and more to surface top performers. Enable expanded mode to get engagement metrics like bounce rate and visit duration per row.

Instructions

Get a ranked breakdown of traffic by one dimension: top pages, referrers, countries, browsers, devices, acquisition channels, custom events, and more.

This is the workhorse for "top N" questions. Set expanded=true when you need engagement quality per row (pageviews, visitors, visits, bounces, time on site) rather than just a visitor count, for example to find which landing page bounces hardest.

Args:

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

  • type (string, required): Dimension to break down by. 'path' (pages), 'entry' (landing pages), 'exit', 'referrer', 'channel', 'domain', 'country', 'region', 'city', 'browser', 'os', 'device', 'language', 'screen', 'title', 'query', 'event', 'hostname', 'tag', 'distinctId'.

  • range (string): Date range, default '7d'.

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

  • expanded (boolean): Return per-row engagement metrics instead of a single count (default: false).

  • limit (number): Rows to return, 1-500 (default: 20).

  • offset (number): Rows to skip for pagination (default: 0).

  • filters (object, optional): Segment filters, for example { country: 'US' } to see top pages among US visitors.

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

Returns: Plain JSON shape: { "type": string, "count": number, "rows": [ { "name": string, "visitors": number, "share_pct": number } ], "has_more": boolean, "next_offset": number } Expanded JSON shape: { "type": string, "count": number, "rows": [ { "name": string, "pageviews": number, "visitors": number, "visits": number, "bounces": number, "bounce_rate_pct": number, "avg_visit_duration_seconds": number } ], ... }

Examples:

  • "What are our top 10 pages this month?" -> type="path", range="this_month", limit=10

  • "Where is traffic coming from?" -> type="referrer", range="30d"

  • "Which landing page has the worst bounce rate?" -> type="entry", expanded=true

  • "Top pages for mobile visitors in Florida" -> type="path", filters={ device: "mobile", region: "US-FL" }

Error handling:

  • Returns "No data" when the dimension has no rows in the range, which is expected for 'event' when no custom events are tracked.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesWhat to break traffic down by. 'path' for pages, 'referrer' for referring URLs, 'channel' for acquisition channel, 'entry'/'exit' for landing and exit pages, 'event' for custom events, plus country, region, city, browser, os, device, language, screen, title, query, domain, hostname, tag, distinctId.
limitNoMaximum rows to return.
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.
offsetNoRows to skip, for pagination.
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'.
expandedNoReturn per-row engagement metrics (pageviews, visits, bounces, time) instead of a single count.
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.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior. The description adds meaningful context beyond those: output shape differences for expanded=true, pagination via offset, filter behavior, and the 'No data' error case. The only slight weakness is that the Returns section describes JSON shapes while the default response_format is 'markdown', leaving the default output representation somewhat underspecified.

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 extremely well structured: purpose, usage guidance, args, returns, examples, and error handling each have a clear section. The most important information is front-loaded, and every section serves a real agent decision, so its length is justified without filler.

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?

Given 10 parameters, nested filter objects, and no output schema, the description is remarkably complete. It documents every parameter with defaults, provides return shapes for both expanded and plain modes, gives multiple examples, and explains the 'No data' case. An agent has enough context to select, parameterize, and interpret this tool 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?

Schema description coverage is 100%, so the baseline is 3. The description adds value above the schema with concrete examples (e.g., top pages for mobile visitors in Florida), clarification that website can be ID/name/domain, range categories, and practical filter usage. It mostly restates schema fields but the examples and contextual hints push it above baseline.

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: 'Get a ranked breakdown of traffic by one dimension,' and enumerates the dimension families (pages, referrers, countries, browsers, etc.). The phrase 'workhorse for top N questions' further clarifies the tool's niche and distinguishes it from aggregate stats or time-series siblings, even though it does not name them explicitly.

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 explicitly says when to use this tool: for 'top N' questions, and when to set expanded=true to get engagement-quality metrics per row. It does not name sibling alternatives or state when not to use this tool in favor of, say, a time-series or aggregate-stats tool, so it stops short of full exclusion guidance.

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