Skip to main content
Glama
arttus

umami-mcp-server

by arttus

Create a segment visible in the Umami UI

umami_create_segment

Build reusable audience segments from one or more filters on dimensions like device, country, or UTM source to isolate and analyze specific visitor groups in Umami.

Instructions

Create a persisted audience Segment (a saved filter combination) that appears under Audience > Segments in the Umami UI.

Args:

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

  • name (string, required): Display name for the segment.

  • filters (array, required): 1+ filters, each { dimension, value, is_not? }. Dimension is one of: path, referrer, title, query, browser, os, device, country, region, city, language, hostname, tag, event, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, segment, cohort.

  • match ('all' | 'any'): Whether every filter must match, or just one (default: 'all').

Returns: { "id": string, "name": string, "type": "segment", "parameters": object }

Examples:

  • "Mobile visitors" -> filters=[{dimension:'device', value:'mobile'}]

  • "Paid social, not from the US" -> filters=[{dimension:'utmMedium', value:'paid'}, {dimension:'country', value:'US', is_not:true}], match='all'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name for the segment.
matchNoWhether every filter must match ('all') or just one ('any').all
filtersYes1 or more filters.
websiteNoWebsite ID (UUID), name, or domain. Optional if UMAMI_DEFAULT_WEBSITE is set. Use umami_list_websites to discover values.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

With annotations already covering readOnlyHint=false, idempotentHint=false, and destructiveHint=false, the description adds meaningful context by stating the segment is 'persisted' and visible in the UI, and by documenting the return shape. It does not contradict the annotations.

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 into Args, Returns, and Examples, and the most important purpose is front-loaded. The examples are useful and the overall length is appropriate, though some parameter details are repeated from the schema.

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?

The description provides enough information for an agent to call the tool correctly: required parameters, optional website handling, valid dimensions, match semantics, examples, and the return shape. Since no output schema is present, documenting the return object is especially valuable.

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 schema carries full parameter documentation. The description adds value by compactly listing the filter dimensions, clarifying the match default, and giving concrete filter examples that make it easy to construct valid calls.

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 names a specific verb ('create') and resource ('persisted audience Segment'), and further clarifies exactly where it appears in the UI ('Audience > Segments'). This cleanly distinguishes it from sibling tools like umami_create_goal or umami_create_cohort.

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 description implies usage by defining what a segment is and providing practical examples such as 'Mobile visitors' and 'Paid social, not from the US'. However, it never explicitly states when to prefer this tool over related alternatives like umami_create_cohort or umami_create_goal.

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