Skip to main content
Glama

Run Command

run_command

Execute a shell command in a specified working directory and return its output, with a configurable timeout for running project checks, scripts, or build tasks.

Instructions

Run a shell command and return its output. Always set a reasonable timeout. Avoid destructive commands (rm -rf, etc.).

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

Input Schema

NameRequiredDescriptionDefault
commandYesThe shell command to run.
workdirNoWorking directory for the command (default: server CWD).
timeout_secondsNoMaximum seconds to wait (default 60, max 300).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so this description has to carry the full burden of describing the tool's behavior. It does disclose two important properties: the tool returns the command's output, and it can run destructive commands, so the agent should be careful. It omits how exit codes and stderr are handled, whether output is truncated, whether the command runs persistently, and what sandbox or permission model applies. This is adequate for an arbitrary-execution tool, but it has clear gaps.

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?

Three short sentences with the core action front-loaded and no filler. The cautionary tail earns its place, though 'Avoid destructive commands (rm -rf, etc.)' duplicates part of the timeout advice and makes the guidance redundant.

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 the description need not explain the response format. For a tool that can execute arbitrary commands with no annotations, however, the description should also say whether commands execute synchronously, whether side effects persist, and how failures surface. It covers what the tool does, but not enough of the risk profile.

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 all three parameters are already documented, including the timeout default and maximum. The description only reinforces the timeout choice and adds no meaning about workdir or command syntax beyond what the schema provides. A baseline score of 3 is appropriate.

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 description names a concrete action and resource: 'Run a shell command and return its output.' That is far more specific than a tautology, and it implicitly distinguishes this tool from the file-oriented siblings like read_file or edit_file. However, it never names an alternative or explicitly states the boundary with those tools.

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?

It gives cautionary advice ('Always set a reasonable timeout,' 'Avoid destructive commands'), which is useful for use. It does not explain when to prefer this tool over the many file and git siblings (for example, read_file vs cat), and it gives no prerequisites or exclusions. The usage guidance is implied and cautionary, not routing guidance.

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