Skip to main content
Glama

claude_wait

Read-onlyIdempotent

Block until async Claude Code tasks finish, then return all results in one call. Tasks keep running past timeouts; call again to keep waiting.

Instructions

Block until one or more async Claude Code tasks complete, then return all results. Pass every task_id you launched in ONE call. Let it run long past your client's backgrounding threshold (short timeouts are raised to a floor; finished tasks return instantly). A wait timeout does NOT kill tasks -- call claude_wait again to keep waiting.

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": {
      "task_ids": "<task_ids>"
    },
    "name": "claude_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
timeoutNoMax seconds to wait (default: 1800). Leave this alone unless you have a specific reason; values below the client backgrounding floor are raised to it. The task keeps running even if this times out.
task_idsYesList of task_ids to wait for.

Output Schema

NameRequiredDescriptionDefault
tasksYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, and non-destructive, so the description earns extra credit for adding behavior beyond them: timeouts are raised to a client floor, finished tasks return instantly, and a timeout does not kill the task. That last point is the key non-obvious behavior an agent needs before deciding whether to retry.

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?

Three tight sentences, front-loaded with the blocking contract, then batching, then timeout behavior. Nothing is repeated from the schema or annotations, and every clause carries actionable information.

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?

An output schema exists, so return values need not be explained, and the description covers the stillness/timeout re-entry loop well. It omits edge behavior such as what happens with an unknown or already-completed task_id, which would matter for a batching wait call.

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 coverage is 100%, so the baseline is 3; the description still adds meaning by telling the agent to batch all task_ids into a single call and by framing timeout as something to leave alone. It goes beyond the schema's 'Max seconds to wait' by explaining the floor-raising rule and that the task survives a timeout.

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: 'Block until one or more async Claude Code tasks complete, then return all results.' This clearly sets it apart from a status-polling sibling like claude_status, since the blocking-and-collect semantics are explicit in the first clause.

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 concrete operational guidance: 'Pass every task_id you launched in ONE call' and 'call claude_wait again to keep waiting' after a timeout. It does not explicitly say when to prefer claude_status or claude_async instead, so the alternative-routing guidance is implied rather than stated.

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