Skip to main content
Glama
This connector has been deprecated

Replaced by io.github.no-fait/infinite-audience

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. Custom membership is published internally; use this tool to read a pending segment publication. Polls GET /v1/segments/{segment_id} every 15 seconds; polling may synchronize an expired status onto the saved segment. 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "segment_id": "<segment_id>"
    },
    "name": "wait_for_segment"
  }
}

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
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"
      +    },
      +    "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",
      +        "custom"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "segment_id",
      +    "name",
      +    "subtype",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / segment_id / description
      Previous value: -"The segment ID returned by create_segment or save_segment"New value: +"The segment ID returned by create_segment"
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: the 15-second poll interval, that polling may write an expired status onto the saved segment (which explains the readOnlyHint=false despite a read-like verb), the SEGMENT_FAILED and SEGMENT_TIMEOUT error behavior, that a timeout does not cancel the job, and the required 'discovery' scope. Not a full 5 only because actual return-field contents are left to the output schema.

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 action, then preconditions, then behavior, then errors and follow-up. Dense but each sentence carries information; the chain of downstream steps (create_audience.segment_refs, quote_delivery, deliver_audience) is slightly compressed in one sentence.

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?

An output schema exists, so return values need not be enumerated, yet the description still summarizes what comes back (customer-facing segment details) and how to use it. For a polling tool with two well-documented params, nothing an agent needs is missing.

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 still adds value by clarifying that a wait timeout is non-destructive and that get_segment is preferable for a single status check. It does not add much about segment_id format beyond what the schema says.

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'", with the terminal conditions spelled out. It is clearly distinguishable from get_segment, which the description later names as the single-check alternative.

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?

Gives explicit preconditions (after create_segment with subtype=matched, after upload, after successful confirm_column_mappings), an explicit prohibition ("Do not call this before confirm_column_mappings"), and an explicit alternative for one-off status checks (get_segment).

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