Skip to main content
Glama
arttus

umami-mcp-server

by arttus

Get revenue attributed from a custom event property

umami_get_revenue
Read-onlyIdempotent

Calculate total and average revenue from numeric custom-event properties, such as purchase amounts, to measure earnings without built-in revenue tracking.

Instructions

Get total and average revenue from a numeric custom-event property, e.g. an 'amount' field on a 'purchase' event.

Self-hosted Umami has no built-in revenue tracking. This works by reading the distribution of a numeric property recorded on a custom event, via umami.track(event_name, { [property]: amount }). It sums (value x occurrence count) across every recorded value.

Args:

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

  • event (string, required): Custom event name, e.g. 'purchase'.

  • property (string, required): Numeric property on that event holding the amount, e.g. 'amount'.

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

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

  • filters (object, optional): Segment filters, e.g. { utmSource: 'google' } for revenue by campaign.

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

Returns: JSON shape: { "event": string, "property": string, "total_revenue": number, "transaction_count": number, "average_value": number }

Error handling:

  • total_revenue of 0 usually means the tracker has never called umami.track(event, { property: number }) in this range, not an error. Check umami_get_metrics with type='event' to confirm the event fires at all.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventYesCustom event name, e.g. 'purchase'.
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.
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'.
propertyYesNumeric event property holding the amount, e.g. 'amount'.
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.1/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 behavioral context: it explains the computation method (summing value x occurrence count across recorded values), the lack of built-in revenue tracking, and the meaning of a zero result. The conflicting default range ('30d' in the description vs '7d' in the schema) is a minor transparency blemish.

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 well-organized with clear sections for purpose, arguments, return shape, and error handling. It is slightly longer than necessary because the Args list repeats schema information, but the added examples and behavioral notes justify most of the length.

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 tool with 8 parameters, nested filter objects, and no output schema, the description does well: it documents the return JSON shape, explains output formats, covers error semantics, and mentions how to discover website IDs. However, the default-range contradiction leaves the agent with conflicting information, so it is not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 does add useful examples and clarifies the relationship between event, property, and tracking, but the Args section largely duplicates the schema. It also contains a factual inconsistency: the description says range defaults to '30d' while the schema says '7d', which reduces trust in the parameter guidance.

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 first sentence states the exact operation: get total and average revenue from a numeric custom-event property, with a concrete 'purchase'/'amount' example. It also distinguishes itself from siblings by explaining that self-hosted Umami has no built-in revenue tracking and by pointing to umami_get_metrics in the error-handling section.

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 gives clear context for when to use the tool: when revenue must be derived from a numeric custom-event property because Umami has no native revenue tracking. It also provides a conditional alternative: if total_revenue is 0, check umami_get_metrics with type='event' to confirm the event fires. It does not enumerate exclusions, but the guidance is sufficient.

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