Skip to main content
Glama
This connector has been deprecated

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

Analyze Segment Upload

analyze_audience_upload
Destructive

After uploading a file to the presigned upload_url (or all same-format shards to upload_urls) returned by create_segment(subtype=matched), call this to run LLM-assisted column mapping inference. For a sharded upload, analysis runs against the first shard only — every shard is assumed to share the same schema; a mismatch fails the batch job later with a specific error, not silently here. Returns: segment_id, analysis.columns[] (each: source_column, mapped_to, inferred_type, confidence 0–1, warning), analysis.unmapped_columns[] (column headers that could not be mapped), analysis.recommendations[] (human-readable tips to improve match rates). gzip is detected from file bytes, so a missing or incorrect compression declaration is self-healed during analysis. Returns typed 422 errors for malformed gzip, format mismatch, or malformed input, and 409 FILE_NOT_YET_UPLOADED before upload. The upload is staged (create_segment sets hitl:true) — nothing has started yet. Present these results to the user and wait for their response, then call confirm_column_mappings (to start resolution) or cancel_matched_upload (to abort) — do not call wait_for_segment before confirm_column_mappings succeeds. 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": "analyze_audience_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
segment_idYesThe segment_id of the matched segment returned by create_segment(subtype=matched)

Output Schema

NameRequiredDescriptionDefault
analysisYes
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.
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "analysis": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "columns": {
      +          "items": {
      +            "additionalProperties": {},
      +            "properties": {
      +              "source_column": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "source_column"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "recommendations": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "unmapped_columns": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "columns",
      +        "unmapped_columns",
      +        "recommendations"
      +      ],
      +      "type": "object"
      +    },
      +    "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"
      +    },
      +    "guidance": {
      +      "description": "Interpretation or recovery guidance for this result",
      +      "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"
      +    },
      +    "segment_id": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "segment_id",
      +    "analysis"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Very rich beyond annotations: staged state (hitl:true), nothing started yet, 422 vs 409 error semantics, gzip self-healing, and the sharded-upload caveat that analysis only inspects the first shard. However, the annotations declare destructiveHint=true and idempotentHint=false, and the description never explains why a pure analysis call is flagged destructive or whether re-calling it twice is safe — that is the one behavioral gap.

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 trigger condition and workflow, then returns, then error codes, then next steps — a sensible order. It is dense and somewhat long, but nearly every clause carries operational meaning.

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?

Despite an output schema existing, the description still names the key result fields and, more importantly, explains the required human-in-the-loop handoff, error taxonomy, and shard-schema assumption — everything an agent needs to call it and act on the result correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single segment_id parameter, and the description only restates that it comes from create_segment(subtype=matched), which the schema already says. Baseline 3 applies since the schema does the heavy lifting.

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 — 'run LLM-assisted column mapping inference' on a staged segment upload — and anchors it to create_segment(subtype=matched). It clearly distinguishes itself from confirm_column_mappings, cancel_matched_upload, and wait_for_segment by naming them as downstream steps.

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 precondition (file already uploaded to the presigned upload_url/upload_urls), an explicit next-step branch (present results, then confirm_column_mappings or cancel_matched_upload), and an explicit exclusion ('do not call wait_for_segment before confirm_column_mappings succeeds').

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