Skip to main content
Glama

wait_trial

Wait for a trial to reach a terminal state in one call, replacing a polling loop. Returns final status plus waited_seconds and timed_out.

Instructions

Wait for a trial to reach a terminal state — one call instead of a polling loop.

Polls get_trial_status internally every poll_seconds until the trial is completed/failed/retryable/abandoned or timeout_seconds elapses (server-side cap: 60s). Returns the final status payload plus 'waited_seconds' and 'timed_out'. Caps the get_trial_status amplification loop: a 60s wait replaces ~30 round-trips.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
trial_idYesID of the target trial.
poll_secondsNoInterval between server-side status checks.
programme_idYesID of the target research programme.
timeout_secondsNoMax seconds to wait server-side (capped at 60 — long trials still need client polling, just far less of it).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNo
reasonNo
statusNo
progressNo
trial_idNo
cancelledNo
started_atNo
eta_secondsNo
finished_atNo
artifact_pathNo
elapsed_secondsNo
executor_outputNo
duration_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.28

TDQS

A4.4/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so well: it discloses the internal polling of get_trial_status, the enumeration of terminal states (completed/failed/retryable/abandoned), the server-side 60s cap, the amplification bound (~30 round-trips), and the extra return fields 'waited_seconds' and 'timed_out'.

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?

Three short, front-loaded paragraphs with no filler; the purpose leads and mechanism/limits follow. Slight overlap between the prose statement of the 60s cap and the schema's own description of it keeps this from a 5.

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 wait/polling tool with no annotations but a full output schema, the description supplies everything the agent needs: terminal-state enumeration, polling cadence, timeout cap, and the additional response fields. Nothing material for correct invocation 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 description coverage is 100%, so the schema already documents all four parameters and the 60s cap on timeout_seconds. The description explains how poll_seconds and timeout_seconds drive the internal loop, which adds mild semantic value, but it is not information the schema lacks — 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 trial to reach a terminal state') plus the mechanism it replaces (a polling loop). An agent can distinguish it from get_trial_status, run_trial, and cancel_trial without opening 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?

Explicitly positions the tool as a replacement for client-side polling of get_trial_status and names the condition that limits it ('long trials still need client polling'). It stops short of an explicit rule for when to call get_trial_status or cancel_trial instead, but the routing context is clear.

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