Skip to main content
Glama

Wait for jobs

wait_jobs
Read-only

Wait until a job or batch finishes instead of checking repeatedly: returns as soon as any (or all) of the given jobs/batches are done, or after timeout_s (max 60) with done=false.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait_jobs"
  }
}

Input Schema

NameRequiredDescriptionDefault
untilNoany (default): return when the first one finishes; all: when all finished.
job_idsNoJob IDs to wait for.
batch_idsNoBatch IDs to wait for (done when all their jobs ended).
timeout_sNoHow long to wait in seconds (default 30, max 60).

Output Schema

NameRequiredDescriptionDefault
doneYesThe wait condition was met (otherwise the time ran out).
nextNoWhat to do if nothing has finished yet.
itemsYesState of each job/batch.
totalYesHow many jobs/batches were given.
finishedNoHow many of the given jobs/batches have ended.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/non-destructive annotations, the description discloses the blocking semantics, the early-return condition for 'any' vs 'all', and the crucial timeout behavior including the 60-second cap and the done=false outcome on expiry. That is exactly the behavioral context an agent needs to avoid misinterpreting a timeout as completion.

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?

A single front-loaded sentence with no filler: the action, the return condition, and the timeout caveat all appear in one efficient clause chain.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With readOnly annotations, full parameter coverage, and an output schema covering return values, the description carries its share of the load. The only minor gap is the unspecified behavior when neither job_ids nor batch_ids is provided and whether the two ID lists can be combined.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents until, job_ids, batch_ids, and timeout_s. The description reinforces the timeout cap and the done=false result but adds no syntax or edge-case detail (e.g., behavior when no IDs are supplied) beyond the structured fields, making the baseline 3 appropriate.

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 names a specific verb and resource ('Wait until a job or batch finishes') and immediately explains the mechanism: returns as soon as any or all of the given jobs/batches are done. The clause 'instead of checking repeatedly' implicitly distinguishes it from polling siblings such as list_jobs or get_job_summary.

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 clearly states the usage context ('instead of checking repeatedly'), which tells an agent to prefer this over polling loops. It does not name a specific alternative sibling or list when-not-to-use cases, so it stops short of the top tier.

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.

Resources