Skip to main content
Glama

run_command

Execute a command in an iTerm2 session and wait for it to finish, then return the resulting screen output. Includes a configurable timeout and supports targeting a specific session.

Instructions

Run a command and wait for it to finish, returning the resulting screen.

Completion is detected via iTerm2's PromptMonitor COMMAND_END notification, which requires iTerm2 shell integration to be installed in the target shell. If the prompt-end event does not arrive within timeout_seconds, the current screen is returned with a [timeout] marker.

:param command: The command line to run. :param session_id: Target session UUID. Defaults to the active session. :param timeout_seconds: How long to wait for COMMAND_END before giving up.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "command": "<command>"
    },
    "name": "run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYes
session_idNo
timeout_secondsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description fully discloses behavior: blocking wait for completion, dependency on PromptMonitor, timeout handling with a [timeout] marker, and return of the resulting screen. This is comprehensive for a command execution tool.

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?

The description is concise (two paragraphs), with the main purpose front-loaded and parameter details clearly listed. Every sentence adds value without redundancy.

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?

Given the tool complexity (3 params, 1 required) and the presence of an output schema, the description covers prerequisites, behavior, and edge cases, making it fully sufficient for correct invocation.

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

Parameters4/5

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

Despite 0% schema description coverage, the description provides meaningful explanations for all three parameters (command, session_id, timeout_seconds), including defaults and purpose. It adds value beyond the schema's bare names and types.

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 tool runs a command and waits for completion, returning the screen output. It specifies the resource (command execution in iTerm2) and the action (run and wait), distinguishing it from siblings like read_screen or write_to_terminal.

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?

The description mentions the prerequisite of iTerm2 shell integration and explains the timeout behavior, but does not explicitly guide when to use this tool versus alternative sibling tools like write_to_terminal or send_control_character.

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