Skip to main content
Glama

Read terminal text

terminal_read
Read-onlyIdempotent

Read a window of a terminal session's buffer, including scrollback and visible screen, to inspect recent or earlier output page by page.

Instructions

Read a window of the terminal buffer. The buffer is the full xterm-emulated state (scrollback + visible viewport) in one contiguous index space. The window is paged from the bottom upward in multiples of rows. rows defaults to the current screen height and is capped at 1000. page: 0 is the most recent screen-sized chunk; page: 1 is the screen before that, and so on. Trailing blank rows are trimmed implicitly.

Input Schema

NameRequiredDescriptionDefault
pageNo0 = newest screen-sized window. N = scroll up N pages (each page = `rows` lines). Past-top clamps.
rowsNoWindow height. Default = current screen height. Max 1000.
cursorNoWhen true (default), mark the cursor inline with "▌". On an empty cell it takes the place of the blank; on a character it is inserted in front of that character, which shifts the rest of that one line right by a column. Nothing is overwritten. Skipped automatically while the program has the cursor hidden. Set to false if you need the unmodified text.
sessionIdYesNumeric id of the session to target. Get one by calling terminal_create. Use terminal_list to enumerate currently-known ids.
highlightsNoWhen true (default), list text on the current screen that is drawn in reverse video or on a background color — how TUIs show the selected menu entry, tab or button — with its screen row and columns. Plain text cannot show this otherwise.
joinWrappedNoWhen true (default), rows the terminal soft-wrapped at its right edge are joined back into the single long line the program printed. Set to false to get one line per screen row.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/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 adds real behavioral context beyond that: the contiguous scrollback+viewport index space, bottom-up paging in `rows` multiples, the 1000-row cap, and implicit trimming of trailing blank rows. It stops short of describing the return payload shape or any error/empty-buffer behavior.

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?

Front-loaded with the core action, then the buffer/window model, then paging semantics, then the trimming note. Every sentence carries information an agent needs to page correctly; nothing is padding.

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?

With no output schema, the description carries the burden of explaining what comes back, and it does reasonably well (a window of buffer text, blank rows trimmed, cursor/highlight/wrap defaults documented in the schema). It could be more explicit about the returned structure (lines vs rows array) for a read tool with several formatting flags, but the model is clear enough to call it correctly.

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 100%, so the schema already documents every parameter and the baseline is 3. The description adds genuine framing on top — that pages are counted upward from the bottom, that rows defaults to the current screen height and is capped at 1000, and that page 0 is the newest chunk — which clarifies the interaction between `page` and `rows`.

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+resource ('Read a window of the terminal buffer') and immediately defines what the buffer is, which cleanly separates it from siblings like terminal_screenshot (renders) and terminal_scroll (moves the viewport). An agent can tell what this returns and from where without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The paging model implicitly tells the agent this is the way to walk back through scrollback, but there is no explicit when-to-use/when-not guidance and no sibling is named (e.g., vs terminal_screenshot or terminal_scroll). Usage must be inferred from the described semantics.

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