Skip to main content
Glama

Wait for a job

wait_for_job
Read-only

Free. Wait up to max_wait_s (at most 20) for a job to finish. If it is still running you get poll_again: true — call again.

Args: job_id: as for get_job. max_wait_s: 1-20 (default 20).

Returns: the get_job answer, plus poll_again: true while it runs

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": {
      "job_id": "<job_id>"
    },
    "name": "wait_for_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYes
max_wait_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the readOnlyHint annotation, the description discloses the cost profile ('Free'), the hard wait ceiling (at most 20s), and the return contract (the get_job answer plus poll_again). It doesn't cover behavior on invalid job ids or jobs that already finished, but it adds real operational context that the annotations do not.

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?

Front-loaded one-line summary followed by compact Args and Returns blocks; every sentence carries information an agent needs to call it in a polling loop, with no filler.

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?

For a two-parameter tool with no output schema and no annotation beyond readOnly, the definition covers purpose, wait bounds, cost, and the exact return shape. Only edge-case behavior (finished, failed, or unknown jobs) is left unstated.

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?

Schema description coverage is 0%, so the description must carry the parameters, and it does: max_wait_s is documented as 1-20 with default 20 (adding a max the schema omits), and job_id is deferred to get_job, which is a reasonable pointer given the sibling exists. The deferral for job_id is the only weak spot.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (wait) and resource (job), including the bounded blocking behavior ('wait up to max_wait_s'), which distinguishes it from the polling sibling get_job by reference to the 'get_job answer'. It stops short of explicitly naming get_job as the non-blocking alternative, so a 4 rather than a 5.

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 gives concrete loop guidance: if the job is still running you receive poll_again: true and should 'call again'. The 'Free' note signals this is the cheap way to wait rather than repeatedly poll, but there is no explicit statement of when to prefer get_job or when not to use this tool.

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