Skip to main content
Glama
hugo94z

mcp-interactive-terminal

by hugo94z

terminal_wait

Block an interactive terminal session until output matches a regex, becomes quiet, exits, or times out, then return the reason, match status, and rendered screen.

Instructions

Block until output matches a regex, becomes 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 or quiet_ms. 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).

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
untilNo
quiet_msNo
session_idYes
timeout_msNo
ignore_echoNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 it does well: it discloses blocking behavior, the four termination reasons, the disabling semantics of quiet_ms=0, and the echo-matching pitfall that ignore_echo exists to avoid. It does not address whether the wait consumes buffered output or how it interacts with concurrent reads, which is the main remaining behavioral gap.

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?

The single-sentence purpose is front-loaded and the Args/Returns blocks are compact. The Args list restates parameter names already visible in the schema, which is mild redundancy, but each line still adds semantics that the schema does not carry.

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, so the description proactively documents the return fields (reason, matched, running, exit_code, screen), which is exactly the right compensation. It is nearly complete for a 5-param tool; the missing piece is the relationship to terminal_read/terminal_screen regarding whether waited-for output is consumed.

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 compensate entirely, and it does: all five parameters get meaning, not just names – a regex example for `until`, the 0-disables rule for `quiet_ms`, and the rationale for `ignore_echo`. `session_id` is tied back to terminal_start, which is the only cross-tool linkage the schema lacks.

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?

States a specific verb (block/wait) and the exact four conditions under which it returns: regex match, quiet, session exit, or timeout. The blocking semantics immediately separate it from the immediate-read siblings terminal_read and terminal_screen, so an agent can pick it without opening a schema.

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 one concrete usage rule – 'Provide at least one of `until` or `quiet_ms`' – which is genuinely useful constraint guidance. However, it never says when to choose this tool over terminal_read or terminal_screen, nor when a quiet wait is preferable to a regex wait. Usage is implied rather than stated.

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