Skip to main content
Glama

run_command

Executes an approved local command in a specified working directory and reports live output, exit code, stdout, stderr, and timeout status.

Instructions

Run an allowed local command and report live output, final exit code, stdout, stderr, and timeout status.

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>",
      "args": "<args>",
      "cwd": "<cwd>"
    },
    "name": "run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdYesAn existing local directory given as an absolute path.
argsYesOne argument per array element. Use [] for no arguments.
commandYesA single program name or executable path.
live_windowNoOpen a local live output window on Windows for longer commands.
timeout_secondsNoCommand timeout in seconds.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does usefully disclose the reporting surface and the fact that commands are permission-gated. It omits key behavioral facts for a process-execution tool: whether the program runs via a shell, whether the process is killed on timeout, and the destructive/irreversible nature of running arbitrary local commands.

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?

A single front-loaded sentence with no filler; the enumerated outputs are informative rather than redundant. Minor inefficiency in restating return fields that the output schema already covers.

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, so return values need not be explained, yet the description still lists them while omitting the safety and permission context that annotations would normally supply. For a command-execution tool with zero annotations, the missing details on sandboxing, timeout kill behavior, and permission prerequisites leave it only minimally complete.

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, args, command, live_window, and timeout_seconds are already fully documented in the input schema. The description adds no additional meaning about argument passing or timeout semantics, so the baseline of 3 applies.

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?

States a specific verb and resource ('Run an allowed local command') and enumerates the reporting surface (live output, exit code, stdout, stderr, timeout status). It does not name or contrast any sibling, but the phrasing around 'allowed' implicitly separates it from list_allowed_commands and request_permission.

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?

Usage is only implied through the word 'allowed', which hints that a permission check must precede execution, but the description never states that prerequisite or points to request_permission / list_allowed_commands. There are no when-not-to-use conditions or alternatives.

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