Skip to main content
Glama
almahdi
by almahdi

pty_read

Read output from a terminal session's buffer, either sequentially or by searching with regex patterns to filter specific lines.

Instructions

Reads output from a PTY session's buffer.

The PTY maintains a rolling buffer of output lines. Use offset and limit to paginate through the output.

Two modes:

  1. Standard mode (no pattern): Returns consecutive lines

  2. Search mode (with pattern): Filters lines by regex, returns matches with line numbers

The buffer stores up to PTY_MAX_BUFFER_LINES (default: 50000) lines. Older lines are discarded when the limit is reached.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe PTY session ID (from pty_spawn)
offsetNoLine number to start reading from (0-based, defaults to 0)
limitNoNumber of lines to read (defaults to 500)
patternNoRegex pattern to filter lines (enables search mode)
ignoreCaseNoCase-insensitive pattern matching (default: false)
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/almahdi/mcp-terminal'

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