Skip to main content
Glama

Read output

read_output
Read-onlyIdempotent

Retrieve command output (stdout/stderr) by reference, using offset and limit to access retained head and tail portions, even when middle bytes are evicted.

Instructions

Read retained command output using an output_ref returned by exec_command/write_stdin. Each stream retains the earliest output (head) plus the most recent output (rolling tail); bytes between them may be evicted and are reported via evicted_gap_bytes. Example: {"output_ref":"command:abc:stdout","offset":0,"limit":4096}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
streamNo
output_refYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A4.4/5.0
Behavior5/5

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

Discloses non-obvious retention behavior: earliest output plus rolling tail, with evicted bytes reported via evicted_gap_bytes. This goes beyond the annotations (readOnlyHint, idempotentHint) and gives the agent an accurate mental model of what data may be missing.

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 plus a compact JSON example. Every sentence adds value: source of output_ref, retention behavior, and a realistic invocation. No filler or repetition of schema/annotations.

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?

Covers the essential behavior, the provenance of output_ref, and an example invocation. Since an output schema exists, return-value details are not required. The stream parameter and offset pagination behavior are minor gaps that could be clarified.

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 0%, so the description must compensate. It provides a concrete example showing output_ref format ('command:abc:stdout') and uses of offset/limit, but it does not explain the stream parameter or offset semantics in prose. Partial compensation leaves some parameters under-documented.

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: 'Read retained command output using an output_ref returned by exec_command/write_stdin'. This clearly distinguishes read_output from read_file and other siblings by tying it to command-execution output rather than file contents.

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 ties usage to output_refs returned by exec_command/write_stdin, establishing a clear when-to-use context. It does not list exclusions or name alternatives, but the precondition is specific enough for an agent to route correctly.

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