Skip to main content
Glama

Watch an agent run

watch_agent_run
Read-onlyIdempotent

Wait on one agent run and follow what its agent does, instead of polling get_agent_run. The call returns when the run ends, when its mission moves to another stage, or after maxSeconds. While it waits, each agent event (a thought, a tool call, a plan update, an error) is sent as a progress notification when the request has a progress token. The result has the status of the run, the stage of its mission, ended, the reason it returned, the last 20 events and a cursor. When the run is still running, call it again with since set to the cursor. A run that already ended returns at once. If your client ends a call after 60 seconds, set maxSeconds below that.

Input Schema

NameRequiredDescriptionDefault
sinceNoThe cursor from an earlier result. Only the events after it are sent
sandboxIdYesAgent run id: the run's sandbox id, from list_agent_runs or get_mission
maxSecondsNoThe longest time to wait, in seconds (default 300, at most 600)

Output Schema

NameRequiredDescriptionDefault
hintNoWhat to do next, when the run is still running
endedYesTrue when the run is no longer running
stageYesThe stage of the run's mission when the call returned
cursorYesThe id of the last event. Give it as since to continue
eventsYesThe last 20 events at most, oldest first
reasonYesWhy the call returned: the run ended, its mission moved to another stage, or maxSeconds passed
statusYesThe status of the run when the call returned
sandboxIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent hints by disclosing the blocking contract (returns on run end, stage transition, or maxSeconds), the progress-notification streaming behavior gated on a progress token, the result payload shape, and the cursor/resume semantics. This is the kind of long-running-call behavior an agent cannot infer from annotations.

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 contract and the anti-polling rationale, and every sentence carries information. The result-field sentence ('the status of the run, the stage of its mission, ended, the reason it returned...') is slightly awkward as a run-on list, but there is no filler.

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 blocking, streaming, cursor-resumable tool, the description covers invocation conditions, resume mechanics, notification behavior, and timeout handling. It even describes return contents despite an output schema existing, leaving no gap an agent needs to close before calling.

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 100%, so baseline is 3, but the description adds real meaning: it ties 'since' to the cursor returned in a prior result and ties maxSeconds to the client's 60-second call cutoff, which is operational guidance the schema does not provide. It stops short of documenting 'sandboxId' beyond what the schema already says.

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 on one agent run and follow what its agent does') and explicitly distinguishes itself from the sibling get_agent_run by naming the polling alternative it replaces. An agent can tell immediately that this is a blocking/following variant rather than a point-in-time read.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance (instead of polling get_agent_run), the three conditions that end the wait, the resume pattern ('call it again with since set to the cursor'), the already-ended fast path, and a concrete client-timeout rule ('If your client ends a call after 60 seconds, set maxSeconds below that'). Nothing is left to inference.

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.