Skip to main content
Glama

Wait for a run

wait_for_run
Read-onlyIdempotent

Wait until a run finishes (succeeded, failed, cancelled, interrupted or timed_out) or the wait ends, then return the run. After the run finishes it keeps waiting, within the same time, until billing has settled (billing_pending false, normally a few seconds to about 20), so the cost is final. Waits at most 60 seconds; if the run is still going, the returned status says so and you can call it again. COST: if the result has cost_final:false, cost_micros is PROVISIONAL and usually higher than the final cost; do not quote it, call get_run again shortly. Quote the cost only when cost_final is true.

Input Schema

NameRequiredDescriptionDefault
idYesThe run's id, as returned by create_run.
timeout_secondsNoHow long to wait, 1 to 60 (default 30).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses the continued wait for billing settlement (seconds to ~20s), the hard 60-second cap, the retry pattern, and the crucial caveat that cost_micros is provisional when cost_final is false. That is exactly the behavioral context an agent needs before quoting a cost.

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-loads the core behavior (what it waits for, then returns) before the billing and cost caveats. Slightly repetitive at the end — the provisional-cost warning and 'quote only when cost_final is true' restate the same point — but every other sentence carries information.

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, the description carries the return-value burden and does so: it names the returned statuses and the cost_final/cost_micros/billing_pending fields and their interpretation. Nothing an agent needs to call it or trust its result is missing.

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 coverage is 100%, so id and timeout_seconds (1–60, default 30) are already fully documented in the schema. The description reinforces the 60-second cap and what happens when the timeout expires, but adds no format or syntax detail beyond the schema. Baseline 3 applies.

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 for a run) and enumerates the terminal states it waits for. It is clearly distinguishable from get_run (non-blocking read) and cancel_run (mutation), since the blocking-with-timeout behavior is spelled out.

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?

Explains the calling pattern: wait up to 60s, and if the run is still going, call it again. It also routes the agent to get_run for provisional-cost rechecks. It doesn't explicitly say when to prefer get_run over wait_for_run up front, so it stops short of full when/when-not guidance.

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.

Resources