Skip to main content
Glama

Wait for a run

wait_for_run
Read-only

Waits for an optimization run to finish by checking progress about every 10 seconds, returning the final verdict and before-to-after figures or a still-running status when the wait limit is reached.

Instructions

Wait for a run to finish, checking about every 10 seconds and reporting progress. Returns the final result (verdict and before -> after figures), or 'still running, call again' when max_wait_s is up: then call wait_for_run again. Optimize runs take 5-60 minutes, so expect several calls.

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": {
      "run_id": "<run_id>"
    },
    "name": "wait_for_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_idYesThe run id.
max_wait_sNoHow long to wait in this call, in seconds (at most 600).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only say this is a safe read; the description goes well beyond by disclosing the ~10s polling interval, the returned payload shape (verdict plus before -> after figures), the timeout sentinel behavior, and the expected 5-60 minute runtime. That is exactly the behavioral context an agent needs to loop correctly.

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 short sentences, front-loaded with the action and return contract, followed by the timeout fallback and duration calibration. Nothing is redundant; even the runtime estimate earns its place by justifying repeat calls.

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?

With no output schema, the description does the necessary work of describing return values and the still-running sentinel. It stops short of covering failure modes, such as an invalid run_id or a run that ends in error/abort, which matters for an open-world tool.

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 run_id and max_wait_s (with default 300 and max 600) are already documented. The description only implies max_wait_s governs when the 'still running' response appears, adding no format or edge-case detail beyond the schema.

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 to finish') plus the polling cadence and what it returns. The blocking semantics and the 'call again' contract separate it from a non-blocking status check without needing to open any 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?

Gives an explicit instruction for the timeout case ('call again') and calibrates expectations with the 5-60 minute optimize-run duration, so the agent knows repeated calls are normal. It does not explicitly name a sibling for a one-shot status peek, but the usage context is clear enough to act on.

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