Skip to main content
Glama
TomHarkness

iTerm2 MCP Server

by TomHarkness

read_session_output

Read an iTerm2 session’s screen output, returning only new lines by default or the last N lines with scrollback to monitor terminal activity and optionally filter results by regex.

Instructions

Read an iTerm2 session's screen. mode 'new' (default) returns only lines not already returned for this session; 'tail' returns the last N lines (scrollback included).

Input Schema

NameRequiredDescriptionDefault
grepNoOnly return lines matching this regex (case-insensitive).
modeNodefault 'new'
linesNoLines for mode 'tail', or first read of a session (default 40).
max_charsNoCap on returned text, keeping the most recent (default 6000).
session_idNoSession ID from list_iterm_sessions. Optional: defaults to the last session used.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/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 discloses important behavior: mode 'new' returns only lines not already returned for this session, while 'tail' includes scrollback. It omits edge cases like invalid session behavior or how the incremental state is tracked, but the core read semantics are clear.

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?

Two front-loaded sentences with no wasted text. The primary purpose is stated first, followed by the mode-specific behavior needed to use 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?

For a read-only session-output tool with no annotations and no output schema, the description explains the essential modes and incremental behavior. It does not explain the return shape in detail, but the parameter schema covers inputs thoroughly and the description is sufficient for correct invocation.

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 all five parameters are already documented in the schema. The description reinforces mode semantics and default behavior, but adds little beyond what the schema provides; baseline 3 is appropriate.

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 an iTerm2 session's screen. It is clearly a read operation on session output, though it does not explicitly distinguish itself from siblings like list_iterm_sessions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains the two modes and the default, which guides mode selection. It does not say when to use this tool versus alternatives such as list_iterm_sessions or execute_command, so usage is only implied.

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