Skip to main content
Glama

Build Segment from Saved Integration Matches

build_saved_integration_segment
Destructive

Create a matched segment, or add unique saved identities to a compatible standalone matched segment. Call preview_saved_integration_segment first and confirm the exact counts and target with the user. Adding to an existing segment replaces its current version. Completion or failure may notify configured organization webhooks, subscriptions, and opted-in user email. This never reruns matching, charges again, or creates an Audience automatically. Requires 'creator' scope.

Input Schema

NameRequiredDescriptionDefault
modeYesCreate a new matched segment or add identities to an existing one
filtersNoSelect saved matches by provider, connection, run, source kind, or time window
request_idNoStable idempotency key; generated when omitted
segment_nameNoName for a new matched segment
target_segment_idNoExisting matched segment ID when mode is add_to_segment

Output Schema

NameRequiredDescriptionDefault
modeYes
statusYes
previewYes
guidanceNoInterpretation or recovery guidance for this result
count_unitNo
page_countNoNumber of objects on this page, not the organization total
count_stateNoUnknown means no count; available does not guarantee freshness. Recount for a current value.
failure_codeYes
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
collection_idYes
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.
identity_countYes
failure_messageYes
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions
target_segment_idYes
materialization_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations flag destructiveHint=true, but the description supplies the specifics: adding replaces the existing segment version, completion/failure may fire webhooks, subscriptions, and opted-in email, and no matching is rerun, no charge is incurred, and no Audience is auto-created. The 'creator' scope requirement is also stated, none of which appears in the annotations.

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?

Six short sentences, front-loaded with the action and the required preview step, followed by consequences. Every sentence contributes a distinct constraint or side effect; nothing is redundant with the schema or annotations.

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 a destructive, open-world mutation with a nested filter object and an output schema, the description covers the prerequisite, the destructive side effect, cost/non-effects, authorization scope, and notification behavior. An agent has everything needed to call it safely without reading further docs.

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 parameters are already documented; the description still adds meaning by constraining target_segment_id to a 'compatible standalone' segment and framing mode as new-vs-add. It does not explain filter interaction or the idempotency key beyond what the schema states, keeping it short of the schema baseline plus full coverage.

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?

Specific verb plus resource ('create a matched segment' / 'add unique saved identities to a compatible standalone matched segment') with both modes named. The phrase 'saved identities' and 'never reruns matching' distinguish it cleanly from create_segment, match_records, and create_audience.

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 an explicit prerequisite workflow ('Call preview_saved_integration_segment first') and a human-in-the-loop condition ('confirm the exact counts and target with the user'). It also narrows the add_to_segment case to a 'compatible standalone' segment, telling the agent when the mode is valid.

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