Skip to main content
Glama
mcp-interactive-terminal

mcp-interactive-terminal

by hugo94z

terminal_wait

Blocks until the shell returns to its prompt, output matches a regex, output goes quiet, the session exits, or a timeout occurs, then returns the rendered screen.

Instructions

Block until the shell is back at its prompt, output matches a regex, output goes quiet, the session exits, or timeout.

Args: session_id: Session returned by terminal_start. until: Case-insensitive regular expression to wait for, e.g. "PS C:\|>>>|Done". quiet_ms: Return when no output arrived for this long (0 disables quiet detection). Provide at least one of until, quiet_ms or prompt. timeout_ms: Give up after this long. ignore_echo: Ignore the echo of the last command line when matching until (prevents matching the command text itself). prompt: Return as soon as the shell shows its prompt again (recommended after a command). history: Number of scrollback lines included in the returned screen. max_chars: Optional cap on the returned screen (0 = no cap).

Returns: reason: "prompt" | "matched" | "quiet" | "exited" | "timeout", matched, running, exit_code, and the rendered screen.

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_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
untilNo
promptNo
historyNo
quiet_msNo
max_charsNo
session_idYes
timeout_msNo
ignore_echoNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.0
    • addedInput schema / properties / history
      Added value: +{
      +  "default": 0,
      +  "title": "History",
      +  "type": "integer"
      +}
    • addedInput schema / properties / max_chars
      Added value: +{
      +  "default": 0,
      +  "title": "Max Chars",
      +  "type": "integer"
      +}
    • addedInput schema / properties / prompt
      Added value: +{
      +  "default": false,
      +  "title": "Prompt",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden well by explaining blocking behavior, possible return reasons, timeout behavior, prompt detection, quiet detection, and echo suppression. It omits edge cases such as invalid session handling or error responses, but the core behavioral contract is 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?

The description is front-loaded with the core blocking behavior and then structured into Args and Returns sections. Every sentence adds information needed to invoke the tool correctly, with no redundant restatement of the schema.

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 an eight-parameter asynchronous terminal tool with no output schema, the definition covers condition selection, parameter semantics, and returned fields well. It could still mention session lifecycle errors or how it relates to sibling read/screen tools, but it is complete enough for correct invocation.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must define parameter meaning, and it does so for all eight parameters. It explains `until` with an example regex, clarifies that `quiet_ms: 0` disables quiet detection, describes `ignore_echo`, and specifies return-size controls.

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 clearly states that the tool blocks until one of several terminal conditions occurs, making the verb and resource specific. It does not explicitly distinguish itself from siblings such as terminal_read or terminal_screen, so it falls short of full sibling differentiation.

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?

It gives useful usage context: provide at least one of `until`, `quiet_ms`, or `prompt`, and recommends `prompt` after a command. It does not compare this wait behavior against alternative sibling tools, leaving some routing guidance implicit.

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