Skip to main content
Glama

Create a segment

createSegment

Save a segment: subscribers that match rules. A segment only ever holds subscribed contacts. Rules: source eq (where they came from); created_at or last_order_at before or after a day; has_purchased eq true or false; order_count or total_spent gte or lte a number (spend in the store's currency); purchased_product_ids contains or excludes a product (bought it, or never did: a membership or a subscription sold as a product separates members from the rest); searched_terms contains or excludes a search exactly as typed on the store. match 'all' needs every rule, 'any' one of them. Answers with the segment's id and how many subscribers it holds now; the id names it for previewSend and draftCampaign. Nobody is mailed. readSegments lists the ones there are.

A change inside Kooga: it runs at once, as the person.

Input Schema

NameRequiredDescriptionDefault
nameYesWhat the segment is called
matchNoall
rulesYes
descriptionNo
workspaceIdNoThe workspace, as listWorkspaces gives it (its id or slug). Leave it out when this connection reaches one workspace.

Output Schema

NameRequiredDescriptionDefault
nameYes
segmentIdYes
subscribersYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false, so the bar is lower; the description still adds real behavior: only subscribed contacts are ever included, no one is mailed, the operation executes immediately, and the response returns the id plus current subscriber count. It doesn't disclose what happens on duplicate names or whether the segment is later editable.

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?

Front-loaded with the core verb and resource, then a compact rule-by-rule enumeration that matches the schema's anyOf branches; nearly every clause carries information. The closing line about running at once 'as the person' is terse to the point of being opaque, the one spot that doesn't fully earn its phrasing.

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?

For a 5-parameter mutation with nested rule variants, the description covers the risky/ambiguous part (rule semantics and match logic), the side-effect profile (no mailings, subscribed-only), and the return shape, so an agent can call it correctly without reading further. An output schema exists, so return values need no more detail.

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?

Schema coverage is only 40%, but the description does the heavy lifting for the complex parameter: every rule field/operator pair is explained semantically (source origin, before/after on a day, gte/lte on counts and spend with currency noted, contains/excludes for products and searched terms), and match 'all' vs 'any' is disambiguated. That adds meaning well beyond the anyOf structure.

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?

Specific verb and resource ('Save a segment: subscribers that match rules') with the scope stated up front, and it explicitly distinguishes itself from the read sibling ('readSegments lists the ones there are'). An agent knows immediately this creates a stored segment rather than listing one.

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?

It makes clear this is for persisting a reusable group and that readSegments is the way to see existing ones, and it pre-empts the sending interpretation with 'Nobody is mailed.' It gives downstream consumers (previewSend, draftCampaign) but stops short of explicit when-not conditions such as how to handle an already-existing equivalent segment.

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.

Resources