Skip to main content
Glama
zix-chen
by zix-chen

Read output

read_output
Read-onlyIdempotent

Retrieve retained stdout/stderr from exec_command or write_stdin using output_ref, paging head and rolling tail while reporting evicted byte gaps.

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
limitNo
offsetNo
streamNo
contentNo
warningsNo
truncatedNo
command_idNo
output_refNo
next_actionNo
next_offsetNo
omitted_bytesNo
requested_offsetNo
evicted_gap_bytesNo
operation_outcomeNo
stream_output_refNo
total_stream_bytesNo
head_retained_bytesNo
stderr_dropped_bytesNo
stdout_dropped_bytesNo
stream_dropped_bytesNo
total_retained_bytesNo
retained_start_offsetNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so the safety profile is covered. The description then adds genuinely useful behavior: the head-plus-rolling-tail retention model and the fact that middle bytes may be evicted and surfaced as evicted_gap_bytes. It stops short of describing pagination progression or error behavior for a stale ref.

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?

Three dense sentences with no filler: purpose and provenance first, retention semantics second, a concrete invocation example last. Everything is front-loaded and each sentence earns its place.

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 needn't be enumerated, and the description still flags the notable field evicted_gap_bytes. With 4 params at 0% schema coverage, a little more on the stream parameter and limit bounds would make it fully self-sufficient for invocation.

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 description coverage is 0%, so the description carries the burden, and it does reasonably: the example maps offset and limit to concrete values, output_ref is tied to exec_command/write_stdin, and the stdout/stderr stream distinction is implied. The `stream` enum and limit bounds (1..1048576) are still only discoverable from the schema.

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 (Read) plus the exact resource (retained command output) and pins the provenance to output_ref values produced by exec_command/write_stdin. That distinguishes it cleanly from siblings like read_file or git_show, which read different sources.

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?

It tells the agent when this tool applies: retrieving retained output using a ref returned by exec_command or write_stdin. The trigger condition is explicit, though it never states when not to use it (e.g., versus re-running a command or reading a file on disk).

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