Skip to main content
Glama

read_output

Read output from a terminal session with three modes: wait for output to settle, incremental read from a cursor, or block until a pattern matches. Returns new output and status flags.

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
context_linesNoLines before/after matched line to include (default: 0, max: 50). Only with wait_for.
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
since_cursorNoRead only output written after this cursor position. Get cursor from previous read_output/send_input/get_session_state responses.
tail_linesNoOn timeout, include last N lines of output (default: 0, max: 100). Only with wait_for.
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.
Behavior4/5

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

With no annotations, description covers key behaviors: three modes, mode 2 response includes has_more and is_truncated, parameter dependencies (e.g., context_lines/tail_lines only for wait_for). Does not disclose error conditions or timeout behavior beyond defaults.

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 concise sentences covering all essential aspects: purpose, three modes, response fields, and parameter constraints. No fluff.

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 complexity of three modes and no output schema, description adequately explains mode behavior and key response fields. Missing error handling or session lifecycle context, but sufficient for a read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds significant meaning: explains mode-specific usage of parameters (max_bytes for mode 2 only, recommended value), default/max for timeout, fallback behavior for wait_for. Goes well beyond 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?

Clearly states it reads output from a session and enumerates three distinct modes (default, since_cursor, wait_for), which distinguishes it from sibling tools like send_input or close_session.

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?

Describes when to use each mode: default for waiting, since_cursor for incremental reads, wait_for for regex blocking. Provides context on mode 2 response fields and parameter constraints, but lacks explicit when-not or comparison to 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