Skip to main content
Glama
This connector has been deprecated

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

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.

  • custom: immutable snapshot; returns 409 CUSTOM_REGENERATION_REQUIRED. Request a new internal data-team publication. Returns 409 SEGMENT_ARCHIVED for archived segments — restore them first with archive_segment(restore=true). Async build completion or failure may notify configured external webhooks and opted-in users by email. Requires 'creator' 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": "refresh_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
hitlNoIf true: 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
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. Added

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond annotations by documenting subtype behavior: filter refresh bumps version, nulls record_count, resets TTL, and can be a no-op unless force is true; matched refresh returns pending with upload URLs and presigned 24h paths; custom returns 409 CUSTOM_REGENERATION_REQUIRED. It also discloses error codes, shared-source handling, notifications, and the required 'creator' scope.

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-loads the core action and scope, then organizes behavior by subtype so an agent can scan the relevant branch. It is dense and long, but most of that length is necessary given the multiple workflows and failure paths; a slightly tighter structure would earn a 5.

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?

Complete for a complex mutation tool: it covers prerequisites, subtype-specific flows, follow-up calls, error cases, and side effects. Since an output schema exists, it does not need to explain return values in detail, and the mention of affected_audiences and status is appropriately supplemental.

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 adds meaningful semantics for hitl, force, and shard_count, including the staged upload sequence and one-header-per-shard requirement, though it does not explain the compression parameter beyond what the schema already provides.

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: 'Re-derive a single stale or expired segment from the current IAG.' It also distinguishes scope from related tools by noting that only the segment is updated while referencing audiences are untouched, and by naming refresh_audience for a whole-composition refresh.

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 routes the agent: use refresh_audience for whole-composition refresh, use count_segment after a filter refresh, use wait_for_segment after a matched upload, and use archive_segment(restore=true) for archived segments. The subtype-specific instructions make the when-to-use conditions concrete.

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