Skip to main content
Glama

Wait For Segment

wait_for_segment
Idempotent

Poll a segment until its status is "active" or "failed". Use after create_segment(subtype=matched) once the file has been uploaded AND confirm_column_mappings has succeeded — the segment will not progress past "pending" before that (the upload is staged). Do not call this before confirm_column_mappings. Also use after create_segment(subtype=similarity/propensity) to wait for the async workflow to complete. Polls GET /v1/segments/{segment_id} every 15 seconds. On success returns the customer-facing segment details — pass segment_id in create_audience.segment_refs, then use the returned audience_id to quote_delivery and deliver_audience. Throws SEGMENT_FAILED if processing failed, or SEGMENT_TIMEOUT if it did not complete within timeout_seconds (default 30 seconds). A wait timeout does not cancel or fail the job; use the corresponding get tool to check it again. Requires 'discovery' scope.

Input Schema

NameRequiredDescriptionDefault
segment_idYesThe segment ID returned by create_segment
timeout_secondsNoMaximum seconds to wait (default 30). Prefer get_segment for a single status check; a wait timeout does not stop processing.

Output Schema

NameRequiredDescriptionDefault
nameYes
statusYes
subtypeYes
guidanceNoInterpretation or recovery guidance for this result
count_unitNo
page_countNoNumber of objects on this page, not the organization total
segment_idYes
count_stateNoUnknown means no count; available does not guarantee freshness. Recount for a current value.
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
record_countNoStored count; null means unknown. Call count_segment for a current count.
record_limitNoMaximum members; null means no explicit cap
filter_groupsNoComplete saved filter definition; one AND group also represents a simple flat filter list
money_displayNoCurrency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.
current_versionNo
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / timeout_seconds / default
      Previous value: -900New value: +30
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"Maximum seconds to wait before giving up. Default 900 (15 min). Use up to 7200 (2hr) for propensity/similarity workflows."New value: +"Maximum seconds to wait (default 30). Prefer get_segment for a single status check; a wait timeout does not stop processing."
    • changedInput schema / properties / timeout_seconds / minimum
      Previous value: -30New value: +1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "count_state": {
      +      "description": "Unknown means no count; available does not guarantee freshness. Recount for a current value.",
      +      "enum": [
      +        "unknown",
      +        "available"
      +      ],
      +      "type": "string"
      +    },
      +    "count_unit": {
      +      "const": "records",
      +      "type": "string"
      +    },
      +    "current_version": {
      +      "type": "number"
      +    },
      +    "filter_groups": {
      +      "description": "Complete saved filter definition; one AND group also represents a simple flat filter list",
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "combinator": {
      +            "description": "Join to the preceding included group; ignored for the first group. AND binds before OR. Exclusion groups always subtract.",
      +            "enum": [
      +              "AND",
      +              "OR"
      +            ],
      +            "type": "string"
      +          },
      +          "filters": {
      +            "items": {
      +              "additionalProperties": {},
      +              "properties": {
      +                "field": {
      +                  "description": "field_name from get_field_catalog; ZIP5 also accepts zip, zip_code or postal_code. Use published operators and enum_values",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "op": {
      +                  "enum": [
      +                    "=",
      +                    "!=",
      +                    "<",
      +                    "<=",
      +                    ">",
      +                    ">=",
      +                    "IN",
      +                    "NOT IN",
      +                    "BETWEEN",
      +                    "LIKE",
      +                    "ARRAY_CONTAINS",
      +                    "ARRAY_CONTAINS_ANY",
      +                    "IS NULL",
      +                    "IS NOT NULL"
      +                  ],
      +                  "type": "string"
      +                },
      +                "text_comparison": {
      +                  "description": "STRING =, !=, IN, NOT IN, LIKE and ARRAY<STRING> ARRAY_CONTAINS, ARRAY_CONTAINS_ANY. Default exact. case_insensitive applies Unicode case folding to stored text and the supplied value; use when capitalization is incidental.",
      +                  "enum": [
      +                    "exact",
      +                    "case_insensitive"
      +                  ],
      +                  "type": "string"
      +                },
      +                "trim_whitespace": {
      +                  "description": "Supported STRING or ARRAY<STRING> comparisons only. Trim leading/trailing whitespace on both sides; default false.",
      +                  "type": "boolean"
      +                },
      +                "value": {
      +                  "anyOf": [
      +                    {
      +                      "type": "string"
      +                    },
      +                    {
      +                      "type": "number"
      +                    },
      +                    {
      +                      "type": "boolean"
      +                    },
      +                    {
      +                      "items": {
      +                        "anyOf": [
      +                          {
      +                            "type": "string"
      +                          },
      +                          {
      +                            "type": "number"
      +                          },
      +                          {
      +                            "type": "boolean"
      +                          }
      +                        ]
      +                      },
      +                      "type": "array"
      +                    },
      +                    {
      +                      "type": "null"
      +                    }
      +                  ],
      +                  "description": "Scalar for comparisons; array for IN/NOT IN; ARRAY_CONTAINS_ANY matches any listed value; [lower, upper] inclusive for BETWEEN; LIKE uses % for any sequence and _ for one character; omit for IS NULL/IS NOT NULL. Use enum_values codes, not display labels"
      +                }
      +              },
      +              "required": [
      +                "field",
      +                "op"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "id": {
      +            "description": "Caller-chosen group ID, for example geography; prefix _exclude:: to subtract this group",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "combinator",
      +          "filters"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "guidance": {
      +      "description": "Interpretation or recovery guidance for this result",
      +      "type": "string"
      +    },
      +    "money_display": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Currency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "name": {
      +      "type": "string"
      +    },
      +    "next_actions": {
      +      "description": "Suggested next calls using returned IDs and available scopes. Not executed and not user consent.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "arguments": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "tool": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "arguments",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "page_count": {
      +      "description": "Number of objects on this page, not the organization total",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "population_input": {
      +      "additionalProperties": {},
      +      "description": "Population input used for the preview; IDs refer to their current saved definitions",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "record_count": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Stored count; null means unknown. Call count_segment for a current count."
      +    },
      +    "record_limit": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Maximum members; null means no explicit cap"
      +    },
      +    "segment_id": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "subtype": {
      +      "enum": [
      +        "filter",
      +        "matched",
      +        "similarity",
      +        "propensity"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "segment_id",
      +    "name",
      +    "subtype",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: 15-second polling against GET /v1/segments/{segment_id}, named error modes (SEGMENT_FAILED, SEGMENT_TIMEOUT), the crucial clarification that a timeout neither cancels nor fails the job, and the 'discovery' scope requirement. The only tension is a minor one—the description frames the tool as read-only polling while readOnlyHint is false—but this is a conservative annotation rather than a genuine contradiction.

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 purpose and terminal states, and nearly every clause is functional (preconditions, error modes, downstream routing). It is dense and somewhat overstuffed—the sequencing advice is spread across three clauses that repeat the create_segment entry point—but nothing is padding.

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?

Covers everything an agent needs to call it correctly: preconditions, poll cadence, timeout behavior, auth scope, failure modes, and what to do next with the result. With an output schema present, the description correctly omits return-field detail and instead explains how the returned handle is consumed downstream.

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?

Schema coverage is 100%, so the baseline is 3; the description earns a step up by giving segment_id downstream meaning ('pass segment_id in create_audience.segment_refs') and reinforcing timeout_seconds' non-destructive semantics. It does not add syntax detail beyond the schema, so it stops short of 5.

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?

States a specific verb and resource ('Poll a segment until its status is "active" or "failed"') plus the exact terminal states. This distinguishes it immediately from single-shot siblings get_segment and get_workflow_status without needing schema inspection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicitly specifies preconditions ('once the file has been uploaded AND confirm_column_mappings has succeeded') and a hard prohibition ('Do not call this before confirm_column_mappings') for the matched subtype, plus a second valid entry point for similarity/propensity. It also names the alternative for the single-check case ('Prefer get_segment for a single status check').

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