Skip to main content
Glama
hugo94z

mcp-interactive-terminal

by hugo94z

terminal_read

Read incremental raw output from an interactive terminal session without duplicates, resuming from a cursor and optionally filtering lines by regex or tail.

Instructions

Read incremental raw output from a session, without duplicates.

Each call returns only what arrived after the previous read. Use the returned cursor with since to resume from an explicit position.

Args: session_id: Session returned by terminal_start. since: Absolute character offset to read from. Defaults to the last read position. max_chars: Maximum characters returned (head+tail with an explicit omission marker). grep: Keep only lines matching this regular expression. tail: Keep only the last N lines (applied after grep). strip_ansi: Remove ANSI escape sequences.

Returns: text, cursor (pass as since), dropped, truncated, running, exit_code.

Note: PowerShell (PSReadLine) repaints the current line with cursor movements, so raw output contains fragments. Use terminal_screen for an authoritative view.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
grepNo
tailNo
sinceNo
max_charsNo
session_idYes
strip_ansiNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses incremental/deduplicated semantics, that max_chars returns head+tail with an explicit omission marker, and that dropped/truncated/running/exit_code flags exist. The PSReadLine repaint caveat is genuinely useful behavioral context a schema could not convey.

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-loaded core sentence, then an Args/Returns/Note structure that is scannable and every line earns its place. Slightly verbose relative to the simple read operation, but the added detail is functional 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?

Although there is no output schema, the Returns line names the returned fields (text, cursor, dropped, truncated, running, exit_code), and the body explains the cursor resume workflow and the authoritative-view caveat. Nothing an agent needs to invoke this correctly appears to be missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate fully, and it does: every one of the six parameters (session_id, since, max_chars, grep, tail, strip_ansi) is given meaning beyond its name, including precedence ('tail applied after grep') and the head+tail truncation behavior of max_chars.

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 and resource (read incremental raw output) and immediately sharpens it with the scoping constraint 'without duplicates' and 'only what arrived after the previous read'. It also names the distinguishing sibling, terminal_screen, for authoritative views, so an agent can tell it apart from the other terminal tools.

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?

Provides clear operational context: use the returned cursor with `since` to resume, and use terminal_screen rather than raw reads when an authoritative view is needed due to PowerShell repaint. It names the key alternative and its trigger condition, though it doesn't enumerate the remaining siblings (terminal_exec, terminal_wait, etc.).

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