Skip to main content
Glama

Refresh Segment

refresh_segment
Destructive

Re-derive a single stale or expired segment from the current IAG. Updates ONLY the segment — referencing audiences are never touched; the response lists them in affected_audiences so you can recount or refresh them (use refresh_audience for a whole-composition refresh). Behaviour is subtype-specific:

  • filter: synchronous — bumps current_version, nulls record_count, resets the 90-day TTL, returns status: active. If the segment is already fresh the call is a no-op (refreshed: false); pass force: true to bump anyway. Call count_segment afterwards for a fresh count.

  • matched: with hitl false/unset (default): returns status: pending + upload_url (24 h presign) targeting the canonical upload path — or upload_urls (an array) when shard_count > 1 — instruct the user to re-upload their identity list (one same-format file per URL for a sharded upload; every CSV shard needs its own header); identity resolution runs automatically once all shards are uploaded. Then call wait_for_segment(segment_id). With hitl: true: the upload is staged instead — after upload, follow the analyze_audience_upload -> confirm_column_mappings / cancel_matched_upload -> wait_for_segment sequence documented on create_segment(subtype=matched). Returns 409 SHARED_SOURCE_DATA for matched duplicates that reference another segment's data — the message names the source segment to refresh instead.

  • similarity: returns status: pending + workflow_run_id (re-launched scoring workflow). Call wait_for_workflow(workflow_run_id).

  • propensity: returns status: pending + workflow_run_id. 422 MISSING_POSITIVE_CLASS_ID for legacy segments that predate positive_class_segment_id storage — archive those with archive_segment and create a replacement. Returns 409 SEGMENT_ARCHIVED for archived segments — restore them first with archive_segment(restore=true). Requires 'creator' scope.

Input Schema

NameRequiredDescriptionDefault
hitlNoIf true: pauses re-launched similarity/propensity workflows at human-in-the-loop gates; stages a matched segment's re-upload instead of resolving automatically. Defaults to false.
forceNoFilter subtype only: bump the version even when the segment already looks fresh. Defaults to false.
segment_idYesThe segment ID to refresh
compressionNoMatched subtype: replacement upload compression.none
shard_countNoMatched subtype: set > 1 for multiple same-format shards.

Output Schema

NameRequiredDescriptionDefault
nameYes
statusYes
subtypeYes
guidanceNoInterpretation or recovery guidance for this result
next_stepYes
refreshedYes
count_unitNo
page_countNoNumber of objects on this page, not the organization total
segment_idYes
upload_urlNo
audience_idNo
count_stateNoUnknown means no count; available does not guarantee freshness. Recount for a current value.
upload_urlsNo
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
workflow_run_idNo
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions
upload_expires_atNo
affected_audiencesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Although annotations already declare destructive=true, idempotent=false, and openWorld=true, the description adds substantial context: version bumping, TTL reset, no-op semantics, 409 SEGMENT_ARCHIVED and SHARED_SOURCE_DATA errors with remediation, 422 MISSING_POSITIVE_CLASS_ID, the 24-hour presign upload flow, and the required 'creator' scope. No statement contradicts 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long, but the length is justified by four distinct subtypes and several error paths. It is front-loaded with the core scope and then structured as per-subtype bullets, with no obvious filler sentences.

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-value explanation is technically optional, yet the description still names key response fields (affected_audiences, status, upload_url, workflow_run_id) and explains every subtype's downstream step. Given the destructive annotation and multi-path behavior, nothing an agent needs in order to call it correctly appears to be 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 schema already documents all five parameters, setting the baseline at 3. The description adds real semantic value by tying force to the filter no-op path, hitl to staged matched uploads and paused workflows, shard_count to the array of upload_urls, and compression to matched re-uploads.

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 description opens with a specific verb and resource ('Re-derive a single stale or expired segment from the current IAG') and immediately scopes it against siblings: it updates ONLY the segment and names refresh_audience for whole-composition refreshes. An agent can distinguish it from refresh_audience, count_segment, and create_segment without inspecting schemas.

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?

It gives subtype-specific when-to-use behavior: filter is synchronous and calls count_segment afterwards; matched requires wait_for_segment and has a HITL staging path; similarity/propensity require wait_for_workflow. It also names alternatives and fallbacks (refresh_audience, archive_segment, create_segment) and states the exact conditions that select them.

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