Skip to main content
Glama

batch_wait

Read-only

Poll a Batch job until its run ends (completed, stopped or failed) or pauses, and return its status and stats like batch_status. If the wait runs out first, it returns the current state with ok:true, timed_out:true and a note: call batch_wait again. A paused run returns at once with paused:true (it does not move until batch_resume). A failed run answers ok:false with error.code and server_code (insufficient_credits, subscription_inactive or api_key_cap_reached). Transient poll errors are retried. A call that carries a progressToken gets a progress notification after each poll.

Input Schema

NameRequiredDescriptionDefault
job_idYesBatch job id returned by batch_create or batch_list
timeoutNoMax wait in seconds (default 50). Many MCP clients cancel a call after 60 s.
timeout_msNoDeprecated: the same wait in milliseconds. Use the seconds parameter instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / job_id / description
      Previous value: -"Batch job id"New value: +"Batch job id returned by batch_create or batch_list"
    • addedInput schema / properties / job_id / minLength
      Added value: +1
    • addedInput schema / properties / timeout
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maximum": 3600,
      +      "minimum": 1,
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Max wait in seconds (default 50). Many MCP clients cancel a call after 60 s."
      +}
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Max wait time in ms (default 600000)"New value: +"Deprecated: the same wait in milliseconds. Use the seconds parameter instead."
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnlyHint/openWorldHint/destructiveHint; the description goes well beyond by disclosing the timeout contract (ok:true, timed_out:true, retry note), the paused-run short circuit, the failed-run error envelope with enumerated error.code/server_code values, automatic retry of transient poll errors, and progress notifications when a progressToken is supplied.

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?

Front-loaded with the purpose, then each subsequent sentence covers a distinct outcome (timeout, pause, failure, retries, progress) with no filler. It is a dense single paragraph rather than a scannable structure, which costs it the top mark.

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?

With no output schema available, the description compensates by spelling out the return shape in each branch (ok/timed_out/paused/error.code) and the side-effect behavior around pause and resume. An agent has everything needed to call it and interpret the response.

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%, with job_id, timeout (default 50, 60s client cancel note) and the deprecated timeout_ms all documented in the schema itself. The description only alludes to the timeout indirectly ('If the wait runs out first') and adds no syntax or unit detail beyond what the schema already provides.

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?

States a specific verb and resource ('Poll a Batch job until its run ends') and names the exact terminal states (completed, stopped, failed) plus the pause case. It also anchors itself against a sibling by saying it returns status and stats 'like batch_status', letting an agent distinguish the blocking variant from the immediate one.

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?

Gives clear operating context: call it when you want to block until the run ends, re-call batch_wait if it times out, and note that a paused run will not advance until batch_resume. It stops short of explicitly saying when NOT to use it (e.g. prefer batch_status for non-blocking polling), so it is strong but not fully routing.

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.