Skip to main content
Glama

Wait For Delivery

wait_for_delivery
Read-onlyIdempotent

Block until a delivery completes or fails. Call this immediately after deliver_audience or deliver_file_match when the response has status: "processing". Polls GET /v1/audiences/{audience_id}/deliveries/{delivery_id} every 15 seconds. On success returns the full delivery object including download_urls[] — share these directly with the user. Each signed link is valid for 24 hours; expires_at is the delivery artifact retention date, not the link expiry. Call get_delivery for a fresh link while the artifact remains available. Throws DELIVERY_FAILED if the export failed (check failure_reason), or DELIVERY_TIMEOUT if it did not finish within timeout_seconds (default 30 seconds). A wait timeout does not cancel or fail the job; use the corresponding get tool to check it again. Requires 'discovery' scope.

Input Schema

NameRequiredDescriptionDefault
audience_idYesAudience ID returned by the delivery or file-match job; do not assume it equals match_id or segment_id
delivery_idYesDelivery ID returned by deliver_audience or deliver_file_match
timeout_secondsNoMaximum seconds to wait (default 30). Prefer get_delivery for a single status check; a wait timeout is not an export failure.

Output Schema

NameRequiredDescriptionDefault
statusYesCurrent delivery state
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.
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
download_urlsNoFresh signed artifact URLs on an individual completed download delivery
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.
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / audience_id / description
      Previous value: -"Audience ID the delivery belongs to (same as match_id for matched audiences)"New value: +"Audience ID returned by the delivery or file-match job; do not assume it equals match_id or segment_id"
    • changedInput schema / properties / timeout_seconds / default
      Previous value: -900New value: +30
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"Maximum seconds to wait. Default 900 (15 min)."New value: +"Maximum seconds to wait (default 30). Prefer get_delivery for a single status check; a wait timeout is not an export failure."
    • changedInput schema / properties / timeout_seconds / minimum
      Previous value: -30New value: +1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "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"
      +    },
      +    "download_urls": {
      +      "description": "Fresh signed artifact URLs on an individual completed download delivery",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "guidance": {
      +      "description": "Interpretation or recovery guidance for this result",
      +      "type": "string"
      +    },
      +    "money_display": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Currency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "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"
      +    },
      +    "status": {
      +      "description": "Current delivery state",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, it discloses the 15s polling interval, the return shape (download_urls[], expires_at semantics vs link expiry), the 24h link validity, both error codes with their meanings, that a timeout does not cancel the job, and the required 'discovery' scope. Rich behavioral context that annotations alone could not convey.

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 core action, then branching into behavior, errors, and prerequisites. Every sentence carries operational value, though it is fairly dense; nothing is wasted but it is near the upper bound of length before becoming a reference doc.

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?

Given a read-only, idempotent wait tool with an output schema and full schema coverage, the description covers the wait/poll semantics, failure modes, link retention nuances, retry/tool-switching guidance, and auth scope. Nothing an agent needs to invoke it correctly is 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 baseline is 3, but the description adds meaning beyond the schema: it clarifies the timeout default (30s) and that a wait timeout is not an export failure, disambiguating timeout_seconds' true effect. The audience_id mis-assumption caveat is in the schema itself, so the description needn't repeat 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?

States a specific verb (block/wait) and resource (a delivery) with clear scope: until it completes or fails. The opening line plus the polling description makes it unambiguous how this differs from the sibling get_delivery, which is named explicitly.

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 precise trigger conditions ('Call this immediately after deliver_audience or deliver_file_match when the response has status: processing') and names alternatives for adjacent cases (get_delivery for a fresh link, get tool to re-check after a timeout). Both when-to-use and when-to-switch are covered.

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