Skip to main content
Glama

read_output

Retrieve terminal output with three modes: wait for settle, incremental read from cursor, or block until regex matches. Supports pagination and truncation detection.

Instructions

Read output from a session. Three modes: (1) default: wait for output to settle, (2) since_cursor: incremental read from a cursor position (returns only new output), (3) wait_for: block until a regex pattern matches. Mode 2 response includes has_more (true = more unread data, call again with new cursor) and is_truncated (true = data was overwritten before you read it).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoMax wait time in seconds (default: 5, max: 600)
wait_forNoRegex pattern to wait for. Falls back to plain text match if regex is invalid.
max_bytesNoMaximum bytes to return in a single read (mode 2 only). If output exceeds this, has_more=true and you should call again with the returned cursor. Recommended: 32768 (32KB) to avoid large context usage.
session_idYesSession ID to read from
tail_linesNoOn timeout, include last N lines of output (default: 0, max: 100). Only with wait_for.
since_cursorNoRead only output written after this cursor position. Get cursor from previous read_output/send_input/get_session_state responses.
context_linesNoLines before/after matched line to include (default: 0, max: 50). Only with wait_for.
Behavior4/5

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

With no annotations, the description fully discloses behaviors: blocking vs non-blocking, response fields, and truncation. However, it does not mention side effects, auth, or prerequisites.

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?

The description is a single efficient paragraph with clear mode enumeration and no redundant sentences. Key information is front-loaded.

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?

Given 7 parameters and no output schema, the description adequately covers modes, response behavior, and parameter usage. Lacks error handling details but is sufficient for selecting and invoking the tool.

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%, but the description adds context on how parameters interact (e.g., tail_lines only with wait_for) and provides usage recommendations like max_bytes=32KB, adding value beyond 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?

The description clearly states 'Read output from a session' and enumerates three distinct modes with specific behaviors, distinguishing it from sibling tools like send_input or get_session_state.

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?

The description explains when to use each mode (default, since_cursor, wait_for) and describes response fields like has_more, but does not explicitly state when not to use the tool or compare with alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raychao-oao/pty-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server