Skip to main content
Glama

wait_for_generation

Monitor a generation job until it completes or times out, retrieving final results after a pending response.

Instructions

Block until a generation reaches a terminal status, or time out.

Resumes waiting on any in-flight job — most usefully after generate returned TIMEOUT_PENDING, or for a job started with wait=false. Polls with backoff (2s growing to a 10s cap, jittered) until the job is "succeeded" or "failed", or until timeout_s elapses (default: PIXIO_DEFAULT_TIMEOUT_S, 180s). Budget actuals are reconciled from the job's real creditsCost when it completes.

On timeout the TIMEOUT_PENDING error again carries the generation_id — the job keeps running server-side and this tool can be called as many times as needed.

Args: generation_id: Id returned by generate. timeout_s: Max seconds to wait; None uses the server default.

Returns: On success the job-result shape: {"generation_id", "status", "output_urls", "outputs", "model_id", "credits_spent", "remaining_balance", "elapsed_s", "error"}. On failure: {"error": {"code", "message", "details"}} with code GENERATION_FAILED (details include the provider reason), TIMEOUT_PENDING (details include generation_id and a resume hint), NOT_FOUND, AUTH, or UPSTREAM_ERROR.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeout_sNo
generation_idYes
Behavior5/5

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

With no annotations provided, the description fully covers behavioral traits: polling with backoff (2s to 10s jittered), timeout handling, credit reconciliation, and return shapes on success and failure. No contradictions.

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 well-organized into logical sections (purpose, usage, behavior, Args, Returns) with no unnecessary words. Every sentence provides value.

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 the tool's complexity (polling, timeout, error handling), the description covers return types, error codes, and usage patterns comprehensively. No output schema exists, but the description includes the return shape.

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 description coverage is 0%, but the description's 'Args' section adds clear meaning: 'generation_id' is the ID from 'generate', and 'timeout_s' is max wait with server default. This fully compensates for missing 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 clearly states 'Block until a generation reaches a terminal status, or time out,' providing a specific verb and resource. It distinguishes from siblings by mentioning its use after 'generate' returns TIMEOUT_PENDING or for jobs with 'wait=false'.

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 explicitly notes when to use the tool (after TIMEOUT_PENDING or wait=false) and explains that it can be called multiple times on timeout. However, it does not explicitly contrast with alternatives like 'get_generation' for non-blocking scenarios.

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

Install Server

Other Tools

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/RealDealCPA-VR/Pixio-MCP'

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