Skip to main content
Glama

wait for any sync job

jobs_wait
Idempotent

Waits up to 50 seconds for a job to reach a final status and returns its latest state, replacing sleep-and-poll loops after a create call returns an id.

Instructions

Wait on the server, for up to about 50 seconds, until any job reaches a final status, then return its latest state in the same shape as jobs_get. Use it after a create tool returns an id, instead of sleeping or calling jobs_get in a loop; if the job is still PENDING or PROCESSING when it returns, call jobs_wait again with the same input. For one check without waiting use jobs_get. It also returns early on result.recoveryRequired and sends progress notifications when the call has a progressToken. Ids by kind:

  • generation: the id from lipsync_create, dubbing_create, lipsync_create-timeline or dialogue-videos_create

  • transcription: the id from transcriptions_create or dialogue-transcriptions_create

  • speaker_analysis: the transcription id

  • translation_preview: the translation-previews_create id, plus its projectId

  • import: the social video link passed to assets_create, plus the same projectId (and projectIntent if that call needed it)

  • batch: the batches_create id Statuses:

  • PENDING, PROCESSING: still running. Never create the job again.

  • COMPLETED, FAILED, REJECTED (the API refused it, such as an import limit or a moderation rejection), CANCELED: final. A speaker analysis that is unavailable, and a generation that lip-synced no frame (its own status NO_OP), read as FAILED. Results:

  • result keeps the kind's original status. A COMPLETED import's result is the saved asset, whose id is the asset id; a finished batch's result.results lists each item's generation status and output.

  • A translation_preview with result.recoveryRequired true has uncertain provider acceptance: do not create another job. Not read-only: an import read repeats the identical assets_create request, so it returns the running import or the saved asset, and starts the import for a link never imported (a non-social media URL is saved as a new VIDEO asset). Errors: an API failure that is not a job status, such as an unknown generation or transcription id or an auth failure, returns {error}; a translation_preview without projectId fails with a plain error message.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "kind": "<kind>",
      "id": "<id>"
    },
    "name": "jobs_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe job id for the chosen kind, as listed in the tool description; for import it is the social video link itself.
kindYesWhich kind of job id is.
projectIdNoRequired for translation_preview; for import, the project passed to assets_create.
projectIntentNoimport only: pass it when the assets_create call for this link needed it.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.4
    • changedInput schema / properties / id / description
      Previous value: -"The job to read; see the tool description per kind."New value: +"The job id for the chosen kind, as listed in the tool description; for import it is the social video link itself."
  2. Addedv0.1.5

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses the ~50-second server-side wait bound, the early return on result.recoveryRequired, and progress notifications when a progressToken is present. It also justifies the readOnlyHint=false annotation by explaining that an import read re-issues the assets_create request and can start an import for a never-imported link, and it describes error shapes ({error} vs a plain error message). That is exactly the extra context annotations cannot carry.

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 core behavior, the alternative, and the retry loop are front-loaded before the bulkier reference material, and the bulleted 'Ids by kind'/'Statuses' sections are scannable. It is long, and the 'Results' section partly restates what the output schema already carries, so a small amount of text does not fully earn its place.

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 six-kind polymorphic wait tool this is complete: status taxonomy including the non-obvious NO_OP-as-FAILED and REJECTED cases, per-kind id sourcing, the projectId/projectIntent conditions, the recoveryRequired hazard with an explicit 'do not create another job' warning, and error semantics. Return-shape detail is partly redundant with the output schema but not harmful.

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 already 100%, yet the description still adds real meaning: the 'Ids by kind' section maps each enum value to the specific tool whose output supplies the id, notes that import's id is the social video link itself, that translation_preview requires projectId, and that projectIntent is import-only and conditional on the original assets_create call. This removes ambiguity the schema cannot express.

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: wait up to ~50 seconds for any job to reach a final status, then return its latest state "in the same shape as jobs_get". It immediately distinguishes itself from the closest sibling (jobs_get for a single non-blocking check), so an agent can route between the two without opening either schema.

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?

Gives explicit when-to-use (after a create tool returns an id), explicit when-not (instead of sleeping or looping jobs_get), the explicit alternative (jobs_get for one check), and the follow-up protocol (if still PENDING/PROCESSING, call again with the same input). It also supplies per-kind id sourcing, telling the agent exactly which create tool produces each accepted kind.

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