Skip to main content
Glama
mcp-interactive-terminal

mcp-interactive-terminal

by hugo94z

terminal_run

Type a command into an interactive shell session and wait until it finishes, returning the resulting screen in one call. Block on the prompt, a regex match, or output silence.

Instructions

Type a command, wait for it to finish, and return the resulting screen in one call.

By default it waits until the shell is back at its prompt. Provide until to wait for a regex instead, or quiet_ms to wait for output to go quiet.

Args: session_id: Session returned by terminal_start. text: Literal command to type. keys: Named keys to send instead of text (see terminal_send). enter: Append Enter after text/keys (default true). until: Case-insensitive regex to wait for instead of the prompt. quiet_ms: Wait for this long without output instead of the prompt. timeout_ms: Give up after this long. max_chars: Maximum characters returned in the screen. history: Number of scrollback lines to prepend to the screen.

Returns: reason ("prompt" | "matched" | "quiet" | "exited" | "timeout"), matched, sent_chars, screen, cursor, running and exit_code.

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": {
      "session_id": "<session_id>"
    },
    "name": "terminal_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNo
textNo
enterNo
untilNo
historyNo
quiet_msNo
max_charsNo
session_idYes
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.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 load and does well: it discloses that the call blocks until prompt/regex/quiet, that timeout_ms defaults to 30000 and causes the call to 'give up', and it enumerates the five termination reasons. Gaps remain on what happens to the running process after a timeout and whether truncation by max_chars is silent, so it is not fully transparent.

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 opening line followed by Args and Returns blocks is a clean, scannable structure with no filler prose. Minor redundancy exists between the summary sentence and the Args entry for `enter`, but the length is justified for a 9-parameter tool.

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?

No output schema exists, and the Returns block compensates by naming every returned field (reason, matched, sent_chars, screen, cursor, running, exit_code). No annotations exist, and the behavioral section covers blocking, timeouts, and wait modes; only post-timeout process state is left undefined for a fairly complex tool.

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?

Schema description coverage is 0% across 9 parameters, so the Args block is doing essential work — every parameter gets a one-line meaning, and defaults for `enter` are restated. It stops short of resolving interaction semantics, e.g. precedence when both `text` and `keys` are supplied, or when `until` and `quiet_ms` are both set.

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 opening sentence names a concrete verb+resource chain ('type a command, wait for it to finish, return the resulting screen in one call') and implicitly separates itself from terminal_send and terminal_start by cross-referencing them for keys and session_id. It never explicitly distinguishes itself from terminal_exec, which likely also runs commands, so an agent still has to guess between those two.

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?

It gives useful in-tool routing — default waits for the prompt, use `until` for a regex, `quiet_ms` for output quiescence — which is real when-to-use guidance for the wait strategy. It says nothing about when to prefer this over terminal_send + terminal_wait or terminal_exec, and no exclusions or prerequisites beyond 'session returned by terminal_start' are stated.

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