Skip to main content
Glama

Wait for tasks

wait_for_tasks
Read-onlyIdempotent

Wait in bounded slices until delegated tasks settle, then return each task's status, outcome and PR URL. Use it only when your next step depends on a task's result.

Instructions

Wait until ad-hoc tasks settle and return each one's status and structured result (outcome, prUrl, verification caveats, error), like devintern worker wait --json. Only wait when the next step needs the outcome. timeoutSeconds is required and capped at 600; tasks usually take much longer than one call, so wait in bounded slices. On timeout the call still succeeds with timedOut: true and the current states. mode "any" returns as soon as one task settles. A worker that is not running fails the wait for pending tasks quickly instead of timing out.

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": {
      "taskKeys": "<taskKeys>",
      "timeoutSeconds": "<timeoutSeconds>"
    },
    "name": "wait_for_tasks"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoall
taskKeysYesAd-hoc task keys (`local-…`) returned by delegate_task or list_my_tasks
timeoutSecondsYesSeconds to wait; capped at 600

Output Schema

NameRequiredDescriptionDefault
tasksNo
messageNo
timedOutNo
errorCodeNoSet on failure: stable error code
nextStepsNoSet on failure: steps to run next (`command` runs on the worker host)
timeoutSecondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds substantial behavior: on timeout the call succeeds with timedOut: true and current states, and a non-running worker fails fast for pending tasks rather than burning the full timeout. Those are exactly the edge cases an agent needs before choosing a timeout value.

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?

Every sentence carries new information — the wait semantics first, then the gating advice, then timeout behavior, then mode, then the failure mode — with no restatement of the name or title. Dense but front-loaded and easy to scan.

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?

An output schema exists, so the brief return-field mention is sufficient, and the blocking, timeout, and fast-fail behaviors are all covered. For a 3-parameter read-only wait tool, an agent has everything needed to call it correctly.

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?

The schema documents taskKeys format and the 600 cap, but the description adds real meaning: the timeout cap is enforced ("required and capped at 600") and mode "any" returns as soon as one task settles, which the bare enum does not convey. The taskKeys provenance (from delegate_task or list_my_tasks) is already in the schema, so no further credit there.

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 ("wait until ad-hoc tasks settle") plus what is returned (status and structured result with outcome, prUrl, verification caveats, error). It is clearly distinguishable from polling siblings like get_task or list_my_tasks because the blocking semantics are stated up front.

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?

"Only wait when the next step needs the outcome" gives an explicit when-to-use condition, and the bounded-slice advice plus the mode "any" note tells the agent how to apply it. It does not name the non-blocking alternative (e.g. get_task) for the case where the outcome is not yet needed, leaving that inference to the agent.

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