Skip to main content
Glama
mcp-interactive-terminal

mcp-interactive-terminal

by hugo94z

terminal_exec

Executes a one-shot non-interactive command in PowerShell, pwsh, cmd, bash or sh and returns its output, exit code and timeout status, saving oversized output to a file.

Instructions

Run a one-shot command to completion and return its output and exit code.

Use this for non-interactive commands. Use terminal_start + terminal_send for programs that need input, a TUI, or a persistent shell.

Args: command: Command line to execute. shell: "powershell", "pwsh", "cmd", "bash" or "sh". cwd: Working directory. Defaults to the server's current directory. env: Extra environment variables. timeout_ms: Kill the command after this long. max_chars: Maximum output characters returned. The full output is written to a temporary file when it is longer; its path is returned as output_file.

Returns: output, output_file, total_chars, exit_code, timed_out, duration_ms, truncated.

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": "terminal_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNo
envNo
shellNo
commandYes
max_charsNo
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.0
    • addedInput schema / properties / shell / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / shell / default
      Previous value: -"powershell"New value: +null
    • removedInput schema / properties / shell / type
      Removed value: -"string"
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden, and it does disclose real behavior: the command is killed after timeout_ms, output beyond max_chars is spilled to a temporary file whose path is returned as output_file, and truncation is flagged. What it does not disclose is the safety/side-effect profile of executing arbitrary shell commands (permission model, sandboxing, whether state persists), which matters for a tool of this class.

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?

Front-loaded one-line summary, then routing guidance, then compact Args/Returns blocks. The Returns block earns its space because no output schema exists, and no sentence is filler.

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 a six-parameter execution tool with no annotations and no output schema, the definition covers purpose, alternatives, every parameter, kill semantics, truncation, and the full return field list. The remaining gap is contextual safety/permission information an agent would want before running arbitrary commands.

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 coverage is 0%, so this is exactly where the description must compensate, and it does: every one of the six parameters gets semantics beyond the schema titles. Notably it enumerates valid shell values (powershell, pwsh, cmd, bash, sh) that the schema does not declare as an enum, and explains cwd's default, env's additive nature, timeout's kill semantics, and max_chars' spill-to-file behavior.

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?

"Run a one-shot command to completion and return its output and exit code" states a specific verb (run), resource (a command), and lifecycle scope (one-shot, to completion), plus the primary return values. It immediately distinguishes itself from the persistent-shell siblings named in the next sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when-to-use ("non-interactive commands") and an explicit when-not-to-use with the alternative named ("terminal_start + terminal_send for programs that need input, a TUI, or a persistent shell"). The routing decision is fully resolved without opening any schema.

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