Skip to main content
Glama

run_command

Destructive

Run a shell command as the signed-in user and return its combined stdout/stderr, ending with [exit=N]. A command still running after 25 s keeps running as a process session until timeoutMs (default 120 s) and the reply gives its id for process_output and stop_process; with a timeoutMs of 25 s or less, a command still running then is not killed but keeps running the same way for up to 10 minutes. On Windows (platform win32) the shell is Windows PowerShell 5.1, not bash or cmd: write PowerShell, e.g. Get-ChildItem -Force; Select-String -Path *.log -Pattern error; a; if ($?) { b } in place of a && b. For longer jobs use start_process. For commands that wait for input, use start_process. Reading, listing, searching and editing files also have their own tools with structured results: read_file, list_directory, search_files, search_content, edit_block and write_file; checking the computer, folder sizes and running programs have read-only ones: system_info, disk_usage and list_processes.

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
commandYes
deviceIdNoComputer name or id
priorityNoScheduling priority. Use "low" for heavy or long-running work such as builds, training or test suites.normal
timeoutMsNo
workSessionIdNoFrom create_work_session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / command / minLength
      Removed value: -1
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id; optional with one computer or a default"New value: +"Computer name or id"
  2. Changed2 schema fields changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id from list_devices. Optional with one computer online or a default set."New value: +"Computer name or id; optional with one computer or a default"
    • changedInput schema / properties / workSessionId / description
      Previous value: -"Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work."New value: +"From create_work_session"
  3. Changed1 schema field changed
    • changedInput schema / properties / timeoutMs / default
      Previous value: -30000New value: +120000
  4. Changed2 schema fields changed
    • removedInput schema / properties / cwd / default
      Removed value: -"~"
    • addedInput schema / properties / workSessionId
      Added value: +{
      +  "description": "Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  5. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only state destructive/openWorld/not-readOnly; the description goes well beyond by disclosing the return format with [exit=N], how long-running commands survive as a process session with an id usable by process_output and stop_process, and that the shell on win32 is PowerShell 5.1 rather than bash or cmd. That is exactly the context an agent needs to interpret responses and pick the right dialect, which the structured fields do not provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with purpose and return format, which is good, but the middle timeout explanation is convoluted ("with a timeoutMs of 25 s or less, a command still running then is not killed but keeps running the same way for up to 10 minutes") and hard to parse. Information density is high but the timeout passage could be stated far more plainly.

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

Completeness4/5

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

For a destructive, open-world execution tool it covers shell dialect, exit reporting, session persistence, and alternative tools, which is most of what an agent needs. Remaining gaps — what cwd defaults to, whether commands inherit the user's full privileges, and the security implications flagged by destructiveHint — are minor but not nothing.

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 50% and the description compensates only for timeoutMs (default 120 s, the 25 s survival boundary). cwd, command syntax details, deviceId, workSessionId, and the meaning of priority relative to scheduling are left entirely to the schema or unstated.

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 specific verb and resource ("Run a shell command as the signed-in user") plus the return shape ("combined stdout/stderr, ending with [exit=N]"). It explicitly names the siblings it is not — start_process, read_file, list_directory, search_files, search_content, edit_block, write_file, system_info, disk_usage, list_processes — so an agent can route without opening any other schema.

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

Usage Guidelines5/5

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

Gives concrete when-to-use-elsewhere rules: longer jobs go to start_process, commands that wait for input go to start_process, and file/search/system-inspection work goes to the named read-only and file tools. The Windows Powershell caveat adds a platform condition the agent must apply before writing the command.

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