Skip to main content
Glama

terminal_read

Extract text from terminal windows using UIA or OCR, strip ANSI codes, and retrieve only new output with diff mode to reduce processing overhead.

Instructions

Read current text from a terminal window via UIA TextPattern (falls back to OCR). Strips ANSI escape sequences. sinceMarker: pass the marker from a previous response to get only new output (diff mode — cheaper than full read). Caveats: When the underlying process restarts, the marker is invalidated and full text is returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowTitleYesPartial title of the terminal window (e.g. 'PowerShell', 'pwsh', 'WindowsTerminal').
linesNoTail N lines (default 50).
sinceMarkerNoMarker returned from a previous call. If found in current text, only the diff is returned.
stripAnsiNoStrip ANSI escape sequences (default true).
sourceNo'auto' = UIA TextPattern then OCR fallback; 'uia' = TextPattern only (fail on miss); 'ocr' = OCR only.auto
ocrLanguageNoBCP-47 language tag for OCR fallback (default 'ja').ja
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing: the fallback mechanism (UIA then OCR), ANSI stripping behavior, diff mode optimization with sinceMarker, and important caveats about marker invalidation. It doesn't mention rate limits, permissions needed, or error conditions, but covers core behavioral traits.

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 sentences with zero waste: first states core functionality, second explains the sinceMarker optimization, third provides critical caveat. Every sentence earns its place and information is front-loaded appropriately.

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?

For a tool with 6 parameters, no annotations, and no output schema, the description provides good coverage of behavioral aspects and caveats. It could be more complete by mentioning what the output looks like (text format, error conditions), but given the schema's thorough parameter documentation, it's reasonably complete.

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 the schema already documents all 6 parameters thoroughly. The description adds some context for sinceMarker ('diff mode — cheaper than full read') and mentions ANSI stripping, but doesn't provide additional parameter semantics beyond what's in the schema descriptions.

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?

The description clearly states the verb ('Read'), resource ('current text from a terminal window'), and method ('via UIA TextPattern (falls back to OCR)'). It distinguishes from sibling tools like terminal_send (which sends input) and clipboard_read (which reads clipboard instead of terminal).

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?

The description provides clear context for when to use the sinceMarker parameter ('diff mode — cheaper than full read') and mentions a caveat about process restarts invalidating markers. However, it doesn't explicitly state when to choose this tool over alternatives like screenshot_ocr or perception_read for terminal content.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Harusame64/desktop-touch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server