Skip to main content
Glama
TomHarkness

iTerm2 MCP Server

by TomHarkness

execute_command

Runs a user-approved staged command in an iTerm2 session, waits for output to settle or a prompt, and returns only the new terminal output.

Instructions

Press Enter on the staged command (only after the user approved it). By default waits until the output settles or a prompt returns, then returns just the new output — no separate read needed.

Input Schema

NameRequiredDescriptionDefault
grepNoOnly return lines matching this regex (case-insensitive).
waitNoWait for and return output (default true).
max_charsNoCap on returned text, keeping the most recent (default 6000).
settle_msNoTreat output as done after this long unchanged (default 1200).
timeout_sNoMax seconds to wait (default 20).
session_idNoSession ID from list_iterm_sessions. Optional: defaults to the last session used.
prompt_regexNoRegex matching the prompt line, if the default guess doesn't fit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the default blocking behavior (waits until output settles or a prompt returns) and that only new output is returned. It leaves out important execution-tool traits: what happens on timeout, whether wait=false returns immediately, whether the staged command is consumed or can be re-run, and that running a command can mutate the system.

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?

Two tight sentences with the safety precondition front-loaded and the default behavior immediately after. No filler, though the second sentence compresses three distinct behaviors (waiting, prompt detection, returning incremental output) into one clause.

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

Completeness3/5

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

For a 7-parameter command-execution tool with no annotations and no output schema, the description should cover failure modes and state. It covers the happy path well but says nothing about timeout results, error surfacing, or whether the staged command persists after execution.

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 every parameter is already documented, and the baseline is 3. The description adds a little by explaining that settling or a prompt ends the wait, which ties to settle_ms and prompt_regex, but it says nothing about timeout_s, grep, or max_chars semantics beyond what the schema states.

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?

The description uses a concrete action (press Enter on the staged command) and makes clear this runs something previously prepared rather than building a new command, which separates it from propose_command. It also implicitly distinguishes itself from read_session_output by noting the output comes back inline. It stops just short of naming the sibling that stages the command.

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 parenthetical '(only after the user approved it)' gives an explicit precondition and the closing clause tells the agent not to follow up with a separate read. There is no explicit mention of propose_command as the required prior step or of when to prefer read_session_output, so the routing is implied rather than spelled out.

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