Skip to main content
Glama

wait_for_workflow

Waits for a workflow run to complete, fail, cancel, or need input or attention, returning a resumable snapshot without changing the run.

Instructions

Wait for a workflow run to need attention or finish; read-only and resumable.

timeout_seconds accepts 0..3600 (default 30; 0 reads once). It is honoured as asked, never silently clamped; out of range is INVALID_PARAMS. Breaking change: values above 300 used to be rejected, and 46..300 were silently held for only 45 seconds. until="terminal" holds until the run stops needing the wait, 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.

Returns when the run is completed, failed or cancelled and has finished settling (stop_reason terminal), or reaches needs_input, needs_attention or paused (stop_reason attention), or the hold ends (timeout, ceiling). If reading the run keeps failing for 3 rounds the last good snapshot comes back with stop_reason observation_unavailable, as does an until="terminal" wait on a terminal run that stays settling with its run file unchanged for 300 seconds. Also returns requested/effective timeout, until, timed_out, elapsed_seconds and polling_guidance. Approval read errors alone do not stop the wait for attention; inspect approval_summary.read_errors for incomplete sources. Known unanswered requests and uncertain approval ownership still stop for attention. Progress is sent every 5 seconds, best effort. A wait never changes, resumes or cancels a run.

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": {
      "workflow_run_id": "<workflow_run_id>"
    },
    "name": "wait_for_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
untilNotimeout
timeout_secondsNo
workflow_run_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.14

TDQS

A4.2/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it declares the tool read-only ('A wait never changes, resumes or cancels a run'), documents the 6 hour server ceiling, the 300-second settling cutoff, the 3-round failure path to observation_unavailable, the 5-second progress cadence as best effort, and that approval read errors alone do not stop the wait. It also flags a breaking change in prior timeout behavior, which is exactly the kind of context structured fields cannot convey.

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 lead sentence is well front-loaded, but the body is a dense block with hard line wraps and some redundancy — it enumerates returned fields despite an output schema existing. Sentences such as the one describing an until="terminal" wait on a settling run with an unchanged run file take real effort to parse, which hurts scanability for an agent.

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?

For a long-polling tool with an output schema and no annotations, it covers everything needed to call it correctly: mode selection, bounds, ceiling, client-side deadline caveat, all stop_reason outcomes, and degraded-observation behavior. Nothing an agent must know before invoking it is absent.

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 0%, so the description must compensate, and it does for two of three parameters: timeout_seconds gets its 0..3600 range, default 30, the meaning of 0, INVALID_PARAMS on out-of-range, and the no-silent-clamping guarantee; until's "terminal" mode gets its constraint of requiring timeout_seconds omitted. workflow_run_id is never characterized (format, where to obtain it), which is the remaining gap.

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 opening sentence gives a specific verb and resource ('Wait for a workflow run') plus the two conditions it resolves on (needs attention / finishes) and its safety profile. It does not name the near-siblings wait_for_task or wait_for_tasks, so the agent gets no explicit differentiation, but the workflow-run scope is unambiguous.

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 selection guidance between the two modes: until="terminal" holds until the run stops needing the wait and requires timeout_seconds to be omitted, and it recommends holds <=50 seconds after 'device did not respond' / 'connection closed' errors. What's missing is any statement of when not to call it at all (e.g. versus a plain status read), so the alternative space is only partially covered.

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