Skip to main content
Glama

Read terminal output

terminal_read
Read-onlyIdempotent

Read buffered output from a persistent shell session, returning recent lines or only new output since a provided cursor so agents can inspect command results and logs.

Instructions

Read buffered output from a session. Without "since", returns the last "lines" lines. Pass the previously returned nextSince value to get only new output since that point.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>"
    },
    "name": "terminal_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesSession id (for example "term_1a2b3c4d") or the friendly name given at spawn time.
rawNoReturn raw bytes with ANSI escapes and carriage returns intact. Default false.
linesNoWhen "since" is omitted, return at most this many trailing lines. Default 200.
sinceNoOnly return output with a sequence number at or after this cursor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/non-destructive, so the safety profile is covered. The description adds real value beyond that: the tool reads a *buffer* (so output is history-limited), and it exposes a nextSince cursor for incremental tailing. It doesn't state buffer retention limits or what happens if the cursor is stale, which keeps it from a 5.

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?

Three short sentences, zero filler, and the default behavior is front-loaded before the incremental-cursor case. Every sentence carries information an agent needs to call the tool correctly.

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?

There's no output schema, so the description carries some burden for return values; it partially discharges this by naming nextSince, which is the key output field for pagination. It doesn't describe the rest of the response shape (raw vs rendered text, truncation indicators), leaving a minor gap for a read tool.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3. The description does add one genuinely useful piece of meaning: chaining the previously returned nextSince value into 'since' to fetch only new output. It also clarifies that 'lines' applies only when 'since' is omitted, matching the schema but reinforcing the interaction between the two parameters.

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: 'Read buffered output from a session.' This clearly separates it from the terminal_exec/terminal_run siblings that produce output rather than read it. It stops short of explicitly naming an alternative, so it lands at 4 rather than 5.

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 explicit conditional guidance for the two operating modes: omit 'since' to get a trailing window, or pass the previously returned nextSince cursor to get only new output. It doesn't discuss when to prefer other sibling tools, but for mode selection within this tool the guidance is clear and actionable.

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