Skip to main content
Glama

wait_for_script_run

Read-onlyIdempotent

Wait for a script run to finish and return its result. If it is still running when the wait ends, the reply has wait_timed_out: true — call again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
run_idYesA script run id (srun_...).
wait_secondsNoHow long to wait for the script to finish before returning. Defaults to, and is capped at, 300 s when your client accepts a streamed reply (text/event-stream), 90 s otherwise. The script keeps going when the wait ends first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
callsYesEvery tool call the script made, in order.
errorNo
objectYes
outputNoWhat the script printed (the last 64,000 characters).
resultNoThe script's last expression, as JSON.
reusedNo
statusYes
next_stepNo
created_atYes
started_atNo
completed_atNo
wait_timed_outNoThe wait ended first. The work is still running: follow it with the tool next_step names.
timeout_secondsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds genuine behavioral value beyond that: it discloses the wait_timed_out sentinel and the retry pattern, which the annotations do not convey. It does not describe blocking semantics further, but the incremental disclosure is solid.

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?

Two tight sentences, zero filler, and the primary behavior (wait and return result) is front-loaded ahead of the timeout caveat. Every clause carries information.

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?

An output schema exists, so return values need not be explained, and the description covers the one non-obvious outcome (wait_timed_out) plus the retry action. The only shortfall is the lack of explicit routing against the closely named get_script_run and wait_for_run siblings.

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 description coverage is 100%, so run_id format and the wait_seconds default/cap/streaming nuance are fully documented in the schema. The description adds no parameter-level detail beyond that, which is the expected baseline when the schema does the heavy lifting.

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?

States a specific verb and resource: 'Wait for a script run to finish and return its result.' The resource (script run) is clearly distinct from chat/run siblings. It does not, however, explicitly differentiate itself from get_script_run (non-blocking fetch) or wait_for_run (the non-script equivalent), so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives one useful directive — 'If it is still running when the wait ends... call again' — which tells the agent how to poll. It stops short of naming when to prefer this over get_script_run or wait_for_run, so the usage context is implied rather than declared.

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