Skip to main content
Glama

Wait for a generation to finish

wait_for_generation
Read-onlyIdempotent

Long-poll 1-6 generation jobs together without opening a widget. Pass id with media for one job, or ids (1 to 6 of {id, media}) for several, not both. Waits up to 15 seconds for every job to reach a terminal state, then returns compact indexed statuses and result URLs. Use job IDs returned by generate_image, generate_video, or generate_audio. For larger sets, choose groups of at most 6 and wait for each group. Permanent lookup failures are returned once without blocking the other jobs; transient lookup failures are retried within the timeout. When all_terminal is false, wait poll_after_seconds before calling again. Never call show_generation once per batch job.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait_for_generation"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoA job id.
idsNoFull-profile generation jobs to wait for together.
mediaNoWhich kind of generation the id belongs to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / id / description
      Previous value: -"A job id from a `generate_*` tool or transform, or an episode id from `generate_story_video` (media `video`)."New value: +"A job id."
    • changedInput schema / properties / ids / description
      Previous value: -"Several jobs at once (see SEVERAL ITEMS), instead of `id` and `media`."New value: +"Full-profile generation jobs to wait for together."
    • removedInput schema / properties / ids / items / properties / media / $ref
      Removed value: -"#/properties/media"
    • addedInput schema / properties / ids / items / properties / media / enum
      Added value: +[
      +  "video",
      +  "image",
      +  "audio"
      +]
    • addedInput schema / properties / ids / items / properties / media / type
      Added value: +"string"
    • changedInput schema / properties / media / description
      Previous value: -"Which kind of generation the id belongs to: `video` (a `generate_video` job, any video transform: `upscale_video`, `extend_video`, `edit_video`, `motion_control`, `generate_lipsync`, and a story render; an AI Video Story episode is a `video`), `image` (including `upscale_image`) or `audio`."New value: +"Which kind of generation the id belongs to."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (read-only, idempotent, non-destructive), and the description adds substantive behavior beyond them: a 15-second long-poll ceiling, terminal-state semantics, permanent failures returned once without blocking siblings, transient failures retried within the timeout, and a named all_terminal/poll_after_seconds backoff signal.

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, and virtually every clause carries a constraint an agent needs. The middle section is dense and run-on (failure semantics, timeout, backoff packed into long sentences), costing some scannability but no wasted content.

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?

With no output schema, the description still specifies the return shape ('compact indexed statuses and result URLs') and the terminal-state signal, plus timeout, retry, and batching behavior. Nothing an agent needs to call this 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 baseline is 3, but the description adds a rule the schema cannot express: use `id` with `media` for one job or `ids` for several, 'not both' — a mutual-exclusion constraint. It also clarifies that `ids` entries are `{id, media}` pairs, though it doesn't restate the enum values.

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 and resource: 'Long-poll 1-6 generation jobs together without opening a widget.' The scope (batch of 1-6) and the negation of the sibling's UI behavior (show_generation) make it immediately distinguishable.

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 states the source of IDs (generate_image/generate_video/generate_audio), how to chunk larger sets into groups of at most 6, when to call again ('when all_terminal is false, wait poll_after_seconds'), and an explicit anti-pattern ('Never call show_generation once per batch job').

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.