Skip to main content
Glama

wait_for_tasks

Wait for multiple task IDs to settle, using any or all mode with an optional timeout. Returns compact statuses, terminal IDs, and stop reasons without canceling the observed tasks.

Instructions

Observe 1..32 unique task IDs, returning compact statuses in requested order.

mode any returns when at least one requested task is settled; all waits for every task. timeout_seconds accepts 0..3600 (default 30) and is honoured as asked, never silently clamped; out of range is INVALID_PARAMS. Zero polls immediately. until="terminal" holds until the mode is satisfied, bounded by a 6 hour server ceiling, and requires timeout_seconds to be omitted. Your MCP client's own request deadline still applies. Prefer holds <=50 seconds after remote "device did not respond" or "connection closed" errors; see docs/multi-task-waiting.md. All IDs must exist and pass caller read authorization before waiting. Existence checks and initial metadata share a two-second I/O budget; undecidable existence rejects the request. A final metadata observation can add up to two more seconds. Returns terminal_task_ids, bounded summaries and get_task_status diagnostic references; no output tails. A recovered task whose process is confirmed gone without an observed exit is listed in undecidable_task_ids (status unknown) and counts as settled in both modes, as in wait_for_task, after a short grace if its owning harflow_mcp server is still alive; an uncertain identity keeps waiting. Under until="terminal", targets that stay unobservable for 3 rounds stop the wait with stop_reason observation_unavailable. Rows carry a bounded failure_diagnostic (category, reason) when one exists. Also returns requested/effective timeout, until, timed_out, stop_reason, elapsed_seconds and polling_guidance. Progress is sent every 5 seconds. Timeout and caller cancellation never cancel or signal the observed tasks.

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": "wait_for_tasks"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoany
untilNotimeout
task_idsYes
timeout_secondsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.14

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: timeouts are honoured exactly and out-of-range values are INVALID_PARAMS, timeout and cancellation never signal the observed tasks, a 6-hour server ceiling applies, progress is emitted every 5 seconds, and existence checks consume a two-second I/O budget with a possible two-second extension. It also discloses failure paths (undecidable_task_ids, stop_reason observation_unavailable after 3 rounds) and the client-side deadline caveat, all of which are non-obvious behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core contract is front-loaded, but the body is a dense run-on that mixes operational detail with internal jargon (harflow_mcp server, undecidable_task_ids, 3-round grace) that an agent must parse before acting. Several clauses about return payloads duplicate what the output schema already declares and could be cut.

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 polling tool with four parameters, no annotations, and an output schema, the definition covers timing, authorization, failure modes, and stop conditions thoroughly. It is marginally over-complete on return fields and leaves "settled" loosely defined, but nothing needed to call it correctly is missing.

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 0%, so the description must compensate, and it does for every parameter: mode (any vs all), until (timeout vs terminal, plus the requirement that timeout_seconds be omitted for terminal), timeout_seconds (0..3600, default 30, zero polls immediately, never silently clamped), and task_ids (1..32 unique, must exist, must pass caller read authorization).

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?

"Observe 1..32 unique task IDs, returning compact statuses in requested order" names a specific verb (observe/wait) and resource (task IDs) with an explicit cardinality bound, which distinguishes it from the singular sibling wait_for_task. The mode/until semantics are stated in the same opening block, so an agent can identify the tool without opening the schema.

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 conditions: mode any returns on the first settled task, all waits for every task, until="terminal" holds to completion bounded by a 6-hour ceiling, and holds <=50 seconds are recommended after "device did not respond" errors. It also references get_task_status for diagnostics and wait_for_task as the precedent for undecidable handling. What it lacks is an explicit statement of when to pick wait_for_task or get_task_status instead of this tool.

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