Skip to main content
Glama

terminal

Run shell commands and capture output for tasks like listing files, checking paths, or automating CLI operations, with optional working directory and timeout.

Instructions

Execute a shell command and return the output.

Args:
    command: The shell command to execute (e.g., "ls -la", "pwd", "echo hello")
    working_directory: Optional working directory to run the command in. 
                      If not provided, uses current directory.
    timeout: Optional timeout in seconds (default: 30.0)
    ctx: MCP context (automatically provided)

Returns:
    A string containing the command output, or an error message if execution fails.

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

Input Schema

NameRequiredDescriptionDefault
commandYes
timeoutNo
working_directoryNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full disclosure burden, and for arbitrary shell execution that is a major gap. It mentions only that failures return an error string; nothing is said about the execution environment, sandboxing, working-directory state, or the risk that commands mutate the filesystem, which is the single most important behavioral fact here.

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 core purpose is front-loaded in one sentence, followed by a terse Args/Returns block that is easy to scan. The 'ctx: MCP context (automatically provided)' line is irrelevant noise to a caller, and the Returns section partly restates the output schema.

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?

An output schema exists and all parameters are documented, so the mechanical contract is covered. What is missing is the behavioral contract for an unannotated arbitrary-code-execution tool: safety, permissions, and environment assumptions.

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%, so the description must compensate, and it does: each of the three parameters gets a line, including concrete command examples and the fallback behavior when working_directory is omitted. The timeout default duplicates the schema default, but the explanatory framing still adds value.

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 first sentence gives a specific verb and resource: 'Execute a shell command and return the output,' which tells an agent exactly what the tool does. There are no sibling tools to differentiate from, so it stops just short of a 5.

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

Usage Guidelines2/5

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

The description never says when to prefer this tool, when to avoid it, or what preconditions apply. There is no mention of side effects, persistence of state between calls, or whether destructive commands are permitted, leaving an agent to infer everything about appropriate use.

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

Deploy Server

Other Tools