Skip to main content
Glama

Run Terminal Command

run_terminal_command
Destructive

Runs a shell command on the user's Mac and returns its output. Always active. Disabled when LMCP is in read-only mode. Dangerous commands (sudo, recursive deletes of system/home paths, disk formatting, shutdown/reboot, piping a downloaded script into a shell, fork bombs, daemon control) are refused. Destructive: it previews the command first — pass confirm:true to actually run it. Output and runtime are capped.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe shell command to run (a single command line, executed with /bin/zsh -lc).
confirmNoMust be true to actually run. Without it, a preview of the command is returned.
working_dirNoOptional absolute working directory. Defaults to the user's home directory.
timeout_secondsNoMax seconds to run before it is terminated (default 20, max 60).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputNo
commandNo
exit_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.7/5.0
Behavior5/5

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

With destructiveHint and openWorldHint already declared, the description still adds substantial behavioral detail beyond them: the preview-before-execute flow gated by confirm:true, the enumerated dangerous-command refusals, the read-only mode disable condition, and caps on output and runtime. This is rich disclosure of what the tool will and won't do.

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-loads the core action, then the activation/disable condition, refusal list, confirm behavior and caps. Every sentence carries decision-relevant information with no filler.

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

Completeness5/5

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

For a high-risk shell-execution tool, the description covers the safety gates (preview, refusals, read-only mode) and execution limits, and an output schema exists to cover return values. An agent has everything needed to decide whether and how to call it.

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 coverage is 100% so the baseline is 3, and the description goes slightly further by framing confirm as the switch between preview and actual execution, tying it to the destructive-preview behavior rather than just restating the parameter.

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?

Specific verb+resource (runs a shell command on the user's Mac) with clear scope and return ('returns its output'). Easily distinguished from siblings like shortcuts_run, recipe_run, or web_eval, which are task- or app-specific rather than arbitrary shell execution.

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?

Provides strong conditional context: 'Always active. Disabled when LMCP is in read-only mode', plus the explicit preview/confirm requirement and the list of refused command classes. It does not name alternative tools (e.g., use shortcuts_run for a saved shortcut), so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources