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

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, gte, lt, lte, between (value and value2), any_of and none_of (value is a list of strings), exists, missing, before, after (dates are ISO or now-7d).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / rules / description
      Previous value: -"Conditions 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)."New value: +"Conditions 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, gte, lt, lte, between (value and value2), any_of and none_of (value is a list of strings), exists, missing, before, after (dates are ISO or now-7d)."
    • changedInput schema / properties / rules / properties / rules / items / properties / operator / enum
      Previous value: -[
      -  "is",
      -  "is_not",
      -  "contains",
      -  "not_contains",
      -  "gt",
      -  "lt",
      -  "exists",
      -  "missing",
      -  "before",
      -  "after"
      -]New value: +[
      +  "is",
      +  "is_not",
      +  "contains",
      +  "not_contains",
      +  "gt",
      +  "gte",
      +  "lt",
      +  "lte",
      +  "between",
      +  "any_of",
      +  "none_of",
      +  "exists",
      +  "missing",
      +  "before",
      +  "after"
      +]
    • addedInput schema / properties / rules / properties / rules / items / properties / value / anyOf
      Added value: +[
      +  {
      +    "type": [
      +      "string",
      +      "number",
      +      "boolean"
      +    ]
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / rules / properties / rules / items / properties / value / type
      Removed value: -[
      -  "string",
      -  "number",
      -  "boolean"
      -]
    • addedInput schema / properties / rules / properties / rules / items / properties / value2
      Added value: +{
      +  "type": [
      +    "string",
      +    "number"
      +  ]
      +}
  2. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare that this is a non-read-only, non-destructive, non-idempotent create operation. The description adds meaningful behavioral context by clarifying that it only saves the rules and does not send messages, though it does not cover duplicate-name behavior, permissions, or return value.

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?

Three short sentences, front-loaded with the core action and followed by useful targeting and no-send clarifications. There is no wasted language.

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 create operation with rich nested rule schema and annotations covering safety, the description provides enough context to invoke it correctly. It could be improved by clarifying whether it returns the new segment or how existing segments should be updated instead, but the major call requirements are covered.

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?

The input schema's nested rules description already explains the rule fields, operators, modes, and value formats in detail. The tool description adds only a high-level mention of 'rules on contact fields' and does not explain the 'name' parameter, so it does not add much 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?

The description states a specific verb and resource: it saves a segment of contacts matching field rules, and it clarifies that newsletters, journeys, and messages can target it. It does not explicitly differentiate from sibling tools such as update_segment or list_segments, so it falls short of a 5.

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 by saying the saved segment can be targeted by newsletters, journeys, and messages, but there is no explicit when-to-use guidance or comparison against alternatives like update_segment. The clarification that it saves rules without sending messages is useful context, though not a full usage guideline.

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