Skip to main content
Glama
KevinBuettner

docent-terminal-mcp

read

Read-only

Get terminal session output by line, region, screen row, or byte offset to inspect logs and full-screen programs without redirecting files.

Instructions

Read session output: the log or one region, by line number -- what tail -n, sed -n or head would do on a log file you had redirected to, except that nothing had to be redirected. A reply's "[... N lines omitted (lines A-B) ...]" marker gives the range to read.

view="cooked" (default): the whole-session log as plain text with line numbers, real line breaks only. With region, reads that region; start is a line number (1-based, as shown) to page from. Without start, shows the last limit lines. view="screen": what the terminal shows right now, row by row as tmux renders it (a long line wraps onto several rows), with the size and cursor position. start/limit select screen rows. The view to use for full-screen programs. Note that such programs clip long lines at the window edge; check file contents another way. view="raw": the bytes the program wrote, escape codes included, with control characters spelled out (\e, \r, \xNN). For debugging odd rendering. start is a byte offset; max_bytes bounds the result. With region, reads that region's bytes (bounds may include a little output from either side).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewNo"cooked" (the log as a plain-text file, one entry per real line), "screen" (the terminal as displayed now, rows as tmux renders them; for full-screen programs), or "raw" (the bytes written, escape codes spelled out)cooked
limitNolines (or screen rows) to return; without `start`, the last that many
startNocooked: the line number to start from (1-based, the numbers replies and `search` show; the same in a region and in the log); screen: the first row; raw: the byte offset
regionNoread only this region (its id from a reply header or `regions`); default: the whole session log
sessionYesthe session's name (from session_create or session_list)
max_bytesNoraw view only: the most bytes to return

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.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=true, and the description adds real behavioral context beyond that: per-view return shapes, that screen view clips long lines at the window edge, and that region bounds 'may include a little output from either side'. No error/auth/limit behavior is described, but for a read tool this is a meaningful addition over the annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose and then organizes the three views into clearly separated blocks, so it scans well. It is on the long side, but most sentences carry distinct, actionable information rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values needn't be spelled out, yet the description still covers view selection, parameter interactions, caveats, and the upstream workflow with search/regions. Nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, so parameters (view, limit, start, region, max_bytes) are already documented. The description largely restates those semantics (start as line/row/byte-offset per view, max_bytes raw-only) with only marginal added nuance, so the baseline 3 applies.

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+scope ('Read session output: the log or one region, by line number') and grounds it in familiar Unix analogies (tail/sed/head). It also positions itself against siblings by referencing the `search` omitted-lines marker and `regions` ids as inputs, so an agent knows where read fits.

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 clear when-to-use guidance per view ('The view to use for full-screen programs' for screen, 'For debugging odd rendering' for raw) and shows how a search reply's marker routes into the tool. It stops short of explicit when-not or direct comparison to siblings like session_logs/search for the same content.

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