Skip to main content
Glama

cmd_run

Runs non-interactive Windows CMD commands and prevents hangs by closing stdin and killing the process tree when the timeout expires.

Instructions

Run a Windows CMD command without hanging. Uses cmd.exe /c with stdin closed and process tree kill on timeout. Safe for any non-interactive command.

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

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory. Defaults to the server start directory.
commandYesThe CMD command to run
timeoutNoTimeout in ms. Defaults to 10000. Max 30000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does unusually well: it discloses stdin being closed, no-hang behavior, process-tree kill on timeout, and the timeout ceiling. It omits any warning that this executes arbitrary commands with real side effects and says nothing about required privileges or whether output is captured.

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?

Two tight sentences, front-loaded with the core action and the anti-hang guarantee, with no filler or redundancy.

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?

For a 3-parameter tool with no output schema, the description should say what comes back (stdout/stderr/exit code) and whether timeouts surface as errors. It also leaves sibling selection unresolved, which matters given four closely related command-execution tools.

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 coverage is 100%, so cwd, command, and timeout (with default and max) are already fully documented in the schema. The description adds no parameter-level meaning beyond that, which is the expected baseline when the schema does the work.

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 a Windows CMD command') plus the mechanism (cmd.exe /c), which separates it from powershell_run by shell type. However, it never distinguishes itself from cmd_admin_run or cmd_batch, which are the siblings most likely to be confused with it.

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?

'Safe for any non-interactive command' implies the eligible use case and rules out interactive programs, which is genuine guidance. It stops short of routing: nothing says when to prefer cmd_batch for multiple commands, cmd_admin_run for elevation, or powershell_run for PowerShell syntax.

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