Skip to main content
Glama

Wait For A Hedra Job To Finish

hedra_wait_for_job
Read-onlyIdempotent

Poll a Hedra job until it completes or fails, then return the full result. Simplifies waiting without custom polling code.

Instructions

Poll a job until it reaches COMPLETED or FAILED (or the timeout elapses), then return the full result in one call. This is the simplest way to generate-and-wait without managing your own poll loop.

For batches of jobs, call this once per job_id rather than trying to wait on several at once — there is no multi-job wait tool by design, to keep timeout/backoff behavior predictable per job.

Args:

  • job_id (string, required): the job id from hedra_submit_job.

  • timeout_ms (number, optional, default 300000/5min, max 1200000/20min): give up and return the last-known status after this many milliseconds if the job hasn't finished.

  • poll_interval_ms (number, optional, default 4000): delay between status checks.

Returns: JSON {job_id, status, outputs, error, timed_out}. timed_out is true if the timeout elapsed before completion — in that case status reflects the last poll and the job may still finish later; call hedra_get_job again after more time.

Examples:

  • Use when: "generate this video and tell me when it's ready" -> submit, then wait

  • Don't use when: doing many jobs in parallel and want to check on all of them periodically yourself (poll hedra_get_job_status per job instead, to avoid blocking on one at a time)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job's id, formatted job_<uuid> — returned by hedra_submit_job.
timeout_msNoMax time to wait in ms (default 300000, max 1200000).
poll_interval_msNoDelay between polls in ms (default 4000).
Behavior5/5

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

Annotations provide readOnly/idempotent hints, but the description adds valuable behavioral context: timeout behavior, last-known status semantics, the timed_out flag, and guidance to call hedra_get_job again if timeout occurs. No contradiction with annotations.

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?

Well-structured with Args, Returns, and Examples sections. Each sentence serves a purpose—no filler—and the format makes it easy to scan. Despite the length, it remains concise and front-loaded.

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?

Completely covers the tool's purpose, parameters, return shape (including timeout edge case), and usage patterns. With no output schema, the description successfully carries the burden of explaining expected responses.

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 covers 100% of parameters, but the description enriches each: job_id source from submit, timeout_ms default/max and what happens on timeout, poll_interval_ms as delay between checks. This adds meaning beyond the raw schema definitions.

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 it polls a job until COMPLETED or FAILED (or timeout) and returns the full result in one call. This specific verb+resource+scope distinguishes it from sibling tools like hedra_get_job and hedra_get_job_status, which are single-poll lookups.

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?

Includes explicit 'Use when' and 'Don't use when' examples, naming hedra_get_job_status as the alternative for parallel polling and noting there is no multi-job wait tool by design. This is clear, actionable guidance for tool selection.

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/HemanthDonga/hedra-mcp-server'

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