Skip to main content
Glama

Read terminal output

terminal_read
Read-onlyIdempotent

Captures a terminal session's visible screen and recent scrollback, optionally waits for a regex prompt or marker, strips ANSI escapes, and can capture full tmux history.

Instructions

Capture the visible screen and recent scrollback of a terminal session. Use expect with a regex to wait until a prompt or marker appears; if it does not match within timeout_ms, the result has expect_matched=false and timed_out=true. ANSI escapes are stripped by default. full_history=true captures the whole tmux history.

Input Schema

NameRequiredDescriptionDefault
ansiNoKeep ANSI escape sequences. Default false.
linesNoScrollback lines to capture. Default 120.
expectNoRegex to wait for in the captured output.
sessionYesSession name.
wait_msNoWait before the first capture.
timeout_msNoExpect polling timeout. Default 10000.
full_historyNoCapture the entire tmux history. Default false.
join_wrappedNoJoin wrapped lines (tmux -J). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/destructive=false, so the safety profile is covered. The description adds real behavioral detail: timeout yields expect_matched=false and timed_out=true, ANSI is stripped by default, and full_history pulls the entire tmux history. Possibly missing is pagination or capture size limits, but the core behavior is well disclosed.

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?

Four dense sentences, front-loaded with the core action, then the expect semantics, then two default-behavior notes. No filler or repetition of the title.

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 8 parameters and no output schema, the description compensates by documenting the key return signals (expect_matched, timed_out) and default behaviors. Adequate for correct invocation; a note on what 'visible screen' vs lines bounds mean could add polish.

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%, so baseline is 3; the description goes further by explaining the expect/timeout_ms interaction and the return flags it produces, plus the real effect of ansi and full_history. This adds meaning beyond the per-parameter schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource – 'capture the visible screen and recent scrollback of a terminal session' – which clearly separates it from terminal_write, terminal_create, and file reads. It does not explicitly name a sibling or state scope boundaries, but the operation is unambiguous.

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?

Gives concrete conditional guidance: 'Use expect with a regex to wait until a prompt or marker appears' and when to use full_history. This tells the agent when a parameter pattern applies, though it offers no explicit exclusions or alternatives (e.g. vs read_file or task_output).

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