Skip to main content
Glama
Replaced by its MCP Registry listing

This endpoint is listed in the official MCP Registry as Segwise MCP. If you published it, claim ownership there.

Get Segwise Query

get_segwise_query
Read-onlyIdempotent

Wait for and retrieve a Segwise query started by start_segwise_query. Pass the returned job_id unchanged. This call waits for up to 25 seconds for the query to finish; if status is still running, call it again. Queries can take several minutes and many status checks. A running status means the query is still executing, not that it failed or has no data. Keep calling get_segwise_query with the exact same job_id, respecting poll_after_seconds. Do not start a duplicate query or stop because repeated checks return running. Give brief progress updates while continuing to poll; do not finish with a still-running answer while polling remains available. Stop polling on completed, failed, execution_deadline, an unrecoverable error, or user cancellation. Retry transient status-check errors with bounded backoff and honor retry delays; do not retry authentication or permission failures. If the host prevents further execution, distinguish that interruption from query failure and preserve the job_id for resumption. When status is completed, use the nested result as the answer. If result.reference_upload is present, use its signed instructions to transfer the user-selected file before expires_at. If result.competitor_ads is present, present its numbered ads and available source links alongside the analysis. For each video, show its labeled poster beside the analysis and a clickable Play video link to its asset_url (own creative) or video_url (competitor ad). Prefer the returned image content when the client supports it. Otherwise embed the thumbnail_url as a Markdown image when supported. If the poster is unavailable, still show Play video when a playback URL exists. Keep competitor source_url as a separate ad-library link. For other own creatives show the thumbnail and use asset_url for a requested original. For an expired media link, start a follow-up query in the same conversation to resolve it again. Competitor previews are labeled by ad number. Keep this job_id with its question. Reuse the conversation_id for every question in this user chat and organization, including unrelated questions. Return the IDs to the parent agent when delegating. Jobs are temporary and may be interrupted by a service restart.

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": {
      "job_id": "<job_id>"
    },
    "name": "get_segwise_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesExact job_id returned by start_segwise_query.

Output Schema

NameRequiredDescriptionDefault
errorNo
job_idYes
resultNo
statusYesRunning means keep polling the same job. Completed and failed are terminal statuses.
messageNoGuidance for continuing this running query. Absent for terminal results.
next_actionNoTool to call next with the same job_id when running. Absent for terminal results.
conversation_idNoReuse this handle for every question in this user chat and organization.
organization_idYes
organization_nameYes
execution_deadlineYesLatest RFC3339 finish time while queued, then the execution deadline when the follow-up starts. Polling never extends it.
poll_after_secondsNoMinimum delay in seconds before the next get_segwise_query call when running.
waiting_for_job_idNoPreceding job this follow-up is waiting for. Continue polling this job.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / conversation_id / description
      Previous value: -"History handle for follow-ups to this task."New value: +"Reuse this handle for every question in this user chat and organization."
    • changedOutput schema / properties / result / properties / conversation_id / description
      Previous value: -"History handle for this task. Keep it with this answer and organization_id for follow-ups and delegated work."New value: +"Reuse this history handle for the next question in this user chat and organization, including a change of topic."
  2. Changed3 schema fields changed
    • changedOutput schema / properties / result / properties / competitor_ads / description
      Previous value: -"Ordered competitor ads. Use the one-based ad numbers in the answer. Each source_url opens the ad in its original library."New value: +"Ordered competitor ads. Use the one-based ad numbers. video_url plays the video when available; source_url opens the original ad library entry."
    • addedOutput schema / properties / result / properties / competitor_ads / items / properties / video_url
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / properties / result / properties / own_creatives / description
      Previous value: -"Customer-owned creatives referenced in the answer, in order. asset_url opens the requested original when available. thumbnail_url is an optional poster."New value: +"Ordered customer creatives. Show the thumbnail_url poster when available. For videos asset_url is the Play link; for other formats it opens a requested original."
  3. Changed1 schema field changed
    • changedOutput schema / properties / execution_deadline / description
      Previous value: -"Absolute RFC3339 execution deadline set when this query started. Polling does not extend it. Completed results remain retrievable within the result retention window."New value: +"Latest RFC3339 finish time while queued, then the execution deadline when the follow-up starts. Polling never extends it."
  4. Changed3 schema fields changed
    • addedOutput schema / properties / conversation_id
      Added value: +{
      +  "description": "History handle for follow-ups to this task.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / result / properties / conversation_id / description
      Previous value: -"Conversation continuity handle. Copy this exact value into later start_segwise_query calls for this organization, including after topic changes. If delegated, return it and organization_id unchanged to the parent with the answer so later child agents or subprocesses reuse them."New value: +"History handle for this task. Keep it with this answer and organization_id for follow-ups and delegated work."
    • addedOutput schema / properties / waiting_for_job_id
      Added value: +{
      +  "description": "Preceding job this follow-up is waiting for. Continue polling this job.",
      +  "type": "string"
      +}
  5. Changed1 schema field changed
    • addedOutput schema / properties / result / properties / reference_upload
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Private short-lived PUT instructions for the selected file. Send only the specified headers and file bytes. After success pass upload_id in reference_upload_ids.",
      +  "properties": {
      +    "content_type": {
      +      "type": "string"
      +    },
      +    "expires_at": {
      +      "type": "string"
      +    },
      +    "expires_in": {
      +      "type": "integer"
      +    },
      +    "headers": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "method": {
      +      "type": "string"
      +    },
      +    "size_bytes": {
      +      "type": "integer"
      +    },
      +    "upload_id": {
      +      "type": "string"
      +    },
      +    "upload_url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "upload_id",
      +    "upload_url",
      +    "method",
      +    "headers",
      +    "expires_in",
      +    "expires_at",
      +    "content_type",
      +    "size_bytes"
      +  ],
      +  "type": [
      +    "null",
      +    "object"
      +  ]
      +}
  6. Changed1 schema field changed
    • addedOutput schema / properties / result / properties / own_creatives
      Added value: +{
      +  "description": "Customer-owned creatives referenced in the answer, in order. asset_url opens the requested original when available. thumbnail_url is an optional poster.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "asset_url": {
      +        "type": "string"
      +      },
      +      "format": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "thumbnail_url": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "name",
      +      "format"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  7. Changed1 schema field changed
    • addedOutput schema / properties / result / properties / competitor_ads
      Added value: +{
      +  "description": "Ordered competitor ads. Use the one-based ad numbers in the answer. Each source_url opens the ad in its original library.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "advertiser": {
      +        "type": "string"
      +      },
      +      "format": {
      +        "type": "string"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "network": {
      +        "type": "string"
      +      },
      +      "source_url": {
      +        "type": "string"
      +      },
      +      "thumbnail_url": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "advertiser",
      +      "network",
      +      "format"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
  8. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare this as a read-only, idempotent, non-destructive call; the description adds substantial behavior beyond that: a 25-second long-poll window, multi-minute runtimes, that 'running' is not failure, that jobs are temporary and may be lost to a service restart, and that host interruption must be distinguished from query failure with the job_id preserved. It also covers post-completion behavior for reference_upload expiry and competitor_ad media links.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The core polling contract is front-loaded and well ordered, but the description balloons well past that into presentation instructions for thumbnails, poster images, Markdown fallbacks, and ad-library links. Much of that is rendering guidance rather than tool-selection guidance and dilutes the polling rules an agent most needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 explained, yet the description goes further and explains how to consume nested result fields, which is genuinely useful for a job-style tool. It is fully complete, arguably over-complete, with presentation detail that could be shortened without losing anything an agent needs to call it correctly.

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% and the single parameter is already documented, so the baseline is 3. The description still adds real constraints the schema does not: pass the job_id 'unchanged', keep it bound to its original question, and reuse it across repeated polls rather than regenerating it.

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?

Opens with a specific verb pair and resource: 'Wait for and retrieve a Segwise query started by start_segwise_query'. It explicitly ties itself to the sibling that creates the job, so an agent can distinguish the poll tool from the start tool without inspecting either schema.

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 when-to-use rules (call after start_segwise_query, keep calling with the same job_id), explicit when-to-stop conditions (completed, failed, execution_deadline, unrecoverable error, user cancellation), and explicit anti-patterns (do not start a duplicate, do not stop on repeated 'running'). It also states the retry policy distinction: bounded backoff for transient errors, no retry for auth/permission failures.

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