Skip to main content
Glama

Create Segment

create_segment

Create an audience segment: a saved, dynamic filter over contacts. match all|any combines the rules; lists (by NAME) narrows the base, omitted = all contacts. Each rule has a filter_type: contact_details (built-in field: email_status, verification_status, contact_rating, email_domain, mailbox_provider, signup_source; mailbox_provider and signup_source take operator was or was_not), contact_property (a built-in contact field such as country, city, state or job_title, with property_type text|number|date; Mailercloud does not yet accept custom fields here, so a segment on a custom field is built in Mailercloud under Audience > Segments), tag (operator is_tagged|is_not_tagged, filter_by any_of|all_of, value = tag IDs), or activity (category + activity + filter_by). Operators ending in is_known/is_unknown take no value; any_of takes an array; between/date_between take {from,to}; in_the_last_days takes 1-200 days. For campaign activity, filter_by is one of for, between, any_of_the_last_five, all_of_the_last_five, any_of_last_seven_day, any_of_last_one_month, any_of_last_three_month; for an exact number of days use category subscriber_opened or subscriber_clicked (with match all). The API does not let a rule target one specific campaign. Example 1, contacts who opened any campaign in the last month: {"filter_type":"activity","category":"campaign","activity":"opened","filter_by":"any_of_last_one_month"}; for exactly 30 days: {"filter_type":"activity","category":"subscriber_opened","filter_by":"in_the_last_days","value":30}. Example 2, country is India: {"filter_type":"contact_property","field":"country","property_type":"text","operator":"equal_to","value":"India"}. Rules are validated before any API call; set dry_run: true to preview.

Input Schema

NameRequiredDescriptionDefault
nameYesSegment name, 1-100 characters, unique
listsNoList NAMES to evaluate (max 150). Omit to evaluate all contacts
matchYesall = every rule must match; any = one rule is enough
rulesYesAt least one rule
dry_runNoValidate the rules and show the request without creating anything

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already establish non-read-only, non-destructive, non-idempotent, open-world behavior, and the description adds real value on top: rules are validated before any API call, dry_run previews, custom fields are not yet accepted, and a rule cannot target one specific campaign. The score is capped because it never says what happens on a duplicate name (schema notes uniqueness) or what is returned on success.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the body is one dense paragraph of highly technical material with no bullets or grouping, making the operator and activity rules hard to retrieve. Several clauses restate the schema's field descriptions verbatim, so the wall of text carries cost without adding information.

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 5-parameter create tool with a nested rule array, no output schema and full annotation coverage, the description covers creation semantics, the rule model, validation, preview and known API limitations, which is close to sufficient. It lacks only post-creation behavior (whether the segment evaluates immediately, error shape on invalid rules).

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?

With 100% schema description coverage the baseline is 3, and the description earns above that by explaining cross-field dependencies the schema only hints at: which filter_type each operator family belongs to, that mailbox_provider/signup_source take was or was_not, that property_type picks the operator family, and that certain operators take no value or an array. Two worked examples make the nested rule object concrete in a way the flat schema cannot.

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?

"Create an audience segment: a saved, dynamic filter over contacts" gives a specific verb plus resource and defines what a segment actually is, which no sibling name makes obvious. The rule-model vocabulary that follows immediately distinguishes it from create_list, create_tag and 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the operative mechanics (match all|any, lists narrows the base, omitted = all contacts) and explicitly points at dry_run for preview, which tells the agent when to use the preview path. It never names the alternative tools (list_segments, update_segment, delete_segment) or states exclusions, so it stops short of full routing guidance.

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.