Skip to main content
Glama

wait_for_generation

Poll generation status until it reaches done or failed, then return the terminal record with image URLs for checking success. On timeout, indicates the call should be repeated.

Instructions

Poll get_generation on a backoff until it reaches done / failed.

Args:
    uuid: The UUID returned by ``generate``.
    timeout_s: Return after this many seconds even if still running.
        Default 45 stays under the 60 s per-call limit most MCP clients
        enforce; a ``timeout`` result just means "call again". Only raise
        it (e.g. for video) on clients you know allow long tool calls.

Returns:
    The terminal generation record — which includes generations that
    failed server-side: those are SUCCESSFUL tool calls returning
    ``processing_state: "failed"`` with empty ``image_urls``, so always
    check the state. On tool failure, an ``isError`` result whose
    ``error`` field is ``"timeout"`` (``message`` names the last
    observed state — the generation keeps running server-side and can be
    re-fetched with ``get_generation`` later), ``"auth"``, or
    ``"failed"``.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYes
timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.3.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: polling backoff, timeout semantics (isError with error='timeout', generation keeps running and can be re-fetched), auth/failed errors, and the surprising case where server-side failures are successful calls with processing_state='failed' and empty image_urls.

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

Conciseness5/5

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

The description is dense but every section earns its place: one-line purpose, compact Args, and a Returns block that clarifies success and error variants. No filler or repetition.

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?

For a tool with nuanced async behavior and no annotations, it covers purpose, input provenance, timeout behavior, terminal states, server-side failure semantics, and client-side error codes. The presence of an output schema further reduces the need to describe return structure.

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

Parameters5/5

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

Schema coverage is 0%, but the description compensates completely: uuid is defined as the value returned by generate, and timeout_s is explained with default, client-limit context, call-again meaning, and guidance for raising it. This far exceeds the bare schema.

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?

The first sentence states a specific action—polling get_generation on backoff until done/failed—which clearly identifies the tool as a blocking wrapper over an asynchronous generation. This differentiates it from siblings like get_generation (single status fetch) and generate (starting the operation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains the uuid comes from generate, implying use after generation is started, and gives explicit guidance about timeout_s relative to client call limits and when to raise it. It does not explicitly state 'use get_generation instead for a one-off status check,' so it lacks an explicit exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/maginaryai/maginary-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server