Skip to main content
Glama

Poll Session

exec_poll
Read-onlyIdempotent

Poll a running remote session for new stdout/stderr output, completion status, exit code, and truncation flags. Reuse the returned byte offsets to resume reading only new output.

Instructions

Read new session output from byte offsets: stdout/stderr deltas, done, exit_code, truncation flags. Pass back the offsets from the previous reply to resume. Same payload as exec_wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesPositive id from exec_start.
stderr_offsetNoStderr byte offset to resume from, as returned by the previous poll (default 0).
stdout_offsetNoStdout byte offset to resume from, as returned by the previous poll (default 0).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
doneNo
errorNo
stderrNo
stdoutNo
exit_codeNo
duration_msNo
duration_usNo
stderr_offsetNo
stdout_offsetNo
truncated_stderrNo
truncated_stdoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safe read-only, idempotent profile, and the description is consistent with them (offset-based resume supports idempotency). It adds behavior the annotations cannot convey: that output is delivered as deltas from byte offsets, that truncation flags exist, and that offsets must be carried forward between calls.

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 dense sentences with zero filler; the read/delta semantics come first and the resumption instruction second, which matches how an agent needs the 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-value explanation is not required, and the description plus schema cover the polling loop adequately. The only gap is the missing routing decision against exec_wait, which is more a usage-guidelines issue than a completeness one.

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%: each parameter is documented, including offset defaults and origin from previous polls. The description reinforces the resume pattern but adds no syntax, format, or edge-case detail (e.g. behavior when offsets are stale or beyond the current buffer) beyond the schema.

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 ('Read new session output from byte offsets') and enumerates the payload contents (stdout/stderr deltas, done, exit_code, truncation flags), which an agent can distinguish from write/kill siblings. The relationship to exec_wait is only hinted at via 'Same payload as exec_wait', so it stops short of a clear sibling differentiation.

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?

'Pass back the offsets from the previous reply to resume' gives real procedural guidance for repeated polling, but the description never states when to choose this over exec_wait (the obvious alternative in the sibling list) or when polling is unnecessary. Usage is implied rather than explicit.

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