Skip to main content
Glama

maginary-mcp

Wait for generation

wait_for_generation
Read-onlyIdempotent

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"``.

    **Follow-up actions:** A ``done`` generation's
    ``processing_result.available_actions`` maps slot indices to valid
    action types — e.g. ``{"0": ["upscale_2x", "vary_strong",
    "pan_left", "zoom_out_2x", "img2vid_basic", ...], "global":
    ["reroll"]}``. Use ``execute_action`` with the ``uuid``, a chosen
    ``action_type``, and the ``parent_image_index`` (the slot key as an
    int) to run an action on a specific output image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesGeneration UUID to poll.
timeout_sNoMax seconds to wait before returning a timeout result.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnly, openWorld, idempotent), the description richly discloses behavior: it polls on a backoff, a timeout is a successful tool call with a specific error field, server-side failures appear as 'failed' processing_state with empty image_urls, and the generation keeps running after a timeout. It also details the error field values and follow-up actions, going well beyond the annotation safety profile.

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?

The description is long but purposefully structured with Args, Returns, and Follow-up actions sections. The core purpose is front-loaded in the first sentence. While dense, the detail on failure modes, timeout behavior, and follow-up actions is necessary for correct invocation, so every sentence earns its place. There is minor redundancy in the 'failed' explanation, but it is not excessive.

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?

The description covers polling behavior, timeout semantics, failure interpretation, error field values, and follow-up actions with execute_action. Given the tool's complexity and the presence of an output schema (which handles return shape), this is complete. An agent has everything needed to call the tool correctly and handle all outcomes.

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?

The schema already fully documents both parameters (100% coverage). The description adds meaningful context: uuid is the value returned by generate, and timeout_s default 45 stays under the 60s per-call limit, with a timeout result meaning 'call again.' This enriches parameter understanding beyond the schema descriptions.

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 description opens with a specific verb and resource: 'Poll get_generation on a backoff until it reaches done / failed.' This clearly distinguishes it from generate (which starts a generation), get_generation (a single fetch), and execute_action (which runs follow-up actions). An agent can immediately understand the tool's unique role.

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?

The description implies usage after calling generate and explains when to adjust timeout_s based on client call-length limits. It also clarifies that a timeout result means 'call again' rather than failure. However, it does not explicitly say 'use this instead of manually polling get_generation,' leaving that to inference.

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.