Skip to main content
Glama

Run command

run_command
Destructive

Executes a bash command as the server user, defaults to the project directory, and returns exit code, status, duration, and separate stdout/stderr; long-running commands can run in the background.

Instructions

Run a bash command on this machine as the user who runs the server (that user's rights). Depending on the owner's permission settings a command may wait for approval in the tray or be refused. Default cwd is the project dir. Returns exit_code, status, duration_ms and separate stdout/stderr sections. Output is capped at maxOutputBytes (default 30 KB, head+tail kept, truncation is always reported; a truncated result includes a job_id, and job_output pages the full text). Set wait= to run long commands in background: you get a job_id immediately and poll it with job_status/job_output. Pass a unique requestId to make retries safe (a repeated requestId returns the cached result instead of running again).

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
cwdNo
noteNoShort human-readable explanation (1 line, in the user's language) of what you are about to do and why. Shown to the user on the approval card. Always provide when calling mutating tools.
waitNo
agentNoShort consistent identifier or display name of this agent (e.g. 'Claude · Лендинг', 'Тесты', 'Мой агент'). Used to separate tasks and route tray messages when multiple agents work in parallel.
commandYes
requestIdNo
timeoutMsNo
maxOutputBytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only flag readOnlyHint=false, destructiveHint=true, openWorldHint=true, idempotentHint=false; the description goes well beyond that by naming the approval/refusal gate, the default cwd, the exact return fields (exit_code, status, duration_ms, stdout/stderr), and the 30 KB output cap with head+tail truncation that is always reported. The job_id/background-execution and requestId caching details are operational behaviors an agent could not infer from annotations or schema.

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?

Front-loaded with the core action and scope, then layered with output, truncation, backgrounding, and idempotency details in a logical order. The dense parenthetical stacking ("maxOutputBytes (default 30 KB, head+tail kept, truncation is always reported; a truncated result includes a job_id...)") is information-rich but makes one sentence carry four distinct facts.

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 destructive, open-world shell executor with no output schema and 25% schema coverage, the description supplies the return shape, truncation handling, async job flow, approval gating, and deduplication scheme. An agent has everything needed to call it correctly and to handle the two failure modes the environment imposes.

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 only 25%, so the description must carry the undocumented parameters — and it does for cwd (defaults to project dir), wait (seconds before backgrounding), requestId (deduplicates retries), and maxOutputBytes (default 30 KB, head+tail). timeoutMs and command remain unexplained in both places, leaving a modest gap rather than a void.

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 concrete verb and resource plus execution context: "Run a bash command on this machine as the user who runs the server (that user's rights)". That single clause separates it from the file-oriented siblings (read_file, write_file, file_ops) without needing to name them.

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?

Gives clear conditional guidance: use wait=<seconds> for long-running commands and poll with job_status/job_output, pass requestId to make retries safe, and expect commands to block on tray approval or be refused per owner settings. It stops short of explicit when-not-to-use guidance (e.g. preferring read_file/list_directory over shell equivalents), so it is clear context rather than a full routing rule.

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