Skip to main content
Glama

Update Segment (preview, then confirm)

update_segment
DestructiveIdempotent

Change a segment. Give only what changes: name, match, lists (list names, or all_contacts: true for every contact) or rules; everything left out is kept from the current definition. Rules are replaced as a set, so to change one rule pass all of them (get_segment shows the current rules). The preview shows the full result; it needs confirm: true to apply. 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"}. Set dry_run: true to preview.

Input Schema

NameRequiredDescriptionDefault
nameNoNew segment name; leave out to keep the current one
listsNoNew list NAMES the segment evaluates; leave out to keep the current lists
matchNoall or any; leave out to keep the current one
rulesNoThe complete new rule set, replacing every current rule; leave out to keep the current rules (get_segment shows them)
confirmNoMust be true to replace the segment. Leave it out first to get a preview, show it to the user, and ask them to confirm
dry_runNoValidate the rules and show the request without changing anything
segment_idYesSegment ID (as returned by create_segment)
all_contactsNoSet true to evaluate all contacts instead of specific lists

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond annotations that already flag a destructive, non-read-only mutation, it explains that rules are replaced as a complete set, omitted fields are preserved, confirm:true is required to apply, and dry_run validates without changing data. It also discloses practical limits such as not being able to target a single campaign and custom-field handling in Mailercloud.

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 most important constraints are front-loaded in the first two sentences, and the rule details are relevant for this complex tool. However, the long single paragraph with dense semicolon-separated rule taxonomy is harder to scan than a structured list would be.

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 an eight-parameter update tool with nested rule semantics and no output schema, the description covers the update behavior, preview/confirm lifecycle, rule replacement, operator constraints, edge cases, and examples. An agent has enough context to construct and safely apply an update.

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?

Although the schema already has full parameter descriptions, the tool description adds substantial cross-parameter meaning: operator/value shape rules (is_known/is_unknown, any_of arrays, between objects, 1-200 day ranges), activity filter_by choices, and two worked examples. This materially reduces the chance of malformed rule payloads.

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 gives a clear verb and resource ('Change a segment') and immediately defines the partial-update model: only changed fields are supplied and omitted fields are retained. It also distinguishes viewing current rules via get_segment, so an agent can tell this is an update tool rather than a read or create tool.

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 clearly explains when to omit fields, when to fetch the current rules, and the preview/confirm workflow. It does not explicitly state when to choose create_segment or delete_segment instead, so the sibling routing is clear but not fully spelled out.

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.