Skip to main content
Glama

Create a segment

create_segment

Saves a segment: contacts matching rules on contact fields. Newsletters, journeys and messages can then target it. This action saves the rules without sending messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
rulesYesConditions on contact fields. mode "all" or "any"; each rule is { field, operator, value }. Fields: contact.name, contact.email, contact.consent (subscribed | unknown | unsubscribed), contact.email_status, contact.product_id, contact.created_at, contact.last_seen_at, contact.attributes.<field> (tags are contact.attributes.tags), contact.events.<event>. Operators: is, is_not, contains, not_contains, gt, lt, exists, missing, before, after (dates are ISO or now-7d).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare this as a non-read, non-destructive, non-idempotent write. The description adds real behavioral context beyond that: it creates a saved, reusable audience and explicitly does NOT send messages, which is the key side effect an agent needs to know.

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?

Two tight sentences: the first defines the artifact and its downstream use, the second delivers the critical no-send caveat. Every clause earns its place and the definition is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a create tool with no output schema, the description covers purpose and usage but omits what is returned (e.g., a segment id) and what happens on duplicate names, which matters given idempotentHint=false. Adequate but with clear gaps for a creation action.

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 coverage is 50%, but the undocumented parameter (`name`) is trivial and self-evident, while the complex `rules` parameter is already exhaustively documented in the schema (fields, operators, mode, date syntax). The description only restates 'rules on contact fields,' adding little beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Saves a segment') and clarifies its scope ('contacts matching rules on contact fields'). It differentiates from sending tools with 'saves the rules without sending messages,' though it does not name the closest siblings (list_segments/update_segment).

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?

Usage is implied rather than stated: the description explains the segment becomes a targeting audience for newsletters, journeys and messages, which hints at when to create one. It offers no explicit when-not condition or alternative (e.g., update_segment for existing segments, list_segments to inspect).

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