Skip to main content
Glama

terminal_exec

Execute any shell command and capture its full ANSI-colored output, returning the text plus a capture ID to render as a terminal screenshot later. Use it for logging commands or building terminal captures.

Instructions

Execute any shell command and capture its full output with ANSI colors. Returns output text and a capture ID for later screenshot. Use terminal_exec_screenshot instead if you want the image immediately.

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
cwdNoWorking directory (optional)
commandYesShell command to execute
timeoutNoTimeout in milliseconds (default: 30000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations present, the description carries the full burden. It usefully discloses the return shape (output text plus a capture ID for later screenshot) and ANSI color preservation, but says nothing about execution environment, sandboxing, permissions, side effects of arbitrary command execution, or output truncation limits.

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?

Two sentences, no filler, with the primary behavior and the sibling-routing hint front-loaded in the first sentence. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Return values are covered in lieu of an output schema, and the sibling routing is handled. However, for an unrestricted shell execution tool with zero annotations, the description omits environment, safety, and failure-mode context an agent would need to call it confidently.

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

Parameters3/5

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

Schema description coverage is 100%, so cwd, command, and timeout (with its 30000ms default) are already documented in the schema. The description adds no parameter-level meaning such as how cwd defaults or how the timeout interacts with capture.

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 and resource ('Execute any shell command') plus what it does with the result ('capture its full output with ANSI colors'). It explicitly distinguishes itself from terminal_exec_screenshot by naming the condition that selects the sibling.

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?

The description names an alternative tool and the exact condition for choosing it ('if you want the image immediately'), so the agent does not have to guess between the two. This is explicit when-to-use-which guidance rather than implied context.

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