Skip to main content
Glama

run_command

Execute shell commands in the active VS Code workspace, including Remote-SSH and WSL, and move long-running commands to background tasks when they exceed the wait threshold.

Instructions

Execute a shell command in the active VS Code workspace (Local shell or Remote Shell Integration / SSH on Remote-SSH/WSL windows). Commands exceeding WaitMsBeforeAsync continue as background tasks.

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": {
      "CommandLine": "<CommandLine>",
      "toolSummary": "<toolSummary>",
      "WaitMsBeforeAsync": "<WaitMsBeforeAsync>"
    },
    "name": "run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
CwdNoOptional working directory (defaults to active VS Code workspace folder).
IsDaemonNoSet to true for long-running background servers or watchers.
CommandLineYesThe exact command line string to execute.
toolSummaryYesBrief 2-5 word noun phrase describing the command task.
TargetWindowNoOptional routing target: "auto" (default), "local", "remote", or VS Code window PID.
WaitMsBeforeAsyncYesMilliseconds to wait before backgrounding (500 to 10000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/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 usefully discloses that commands exceeding WaitMsBeforeAsync continue as background tasks and that execution happens in the active workspace shell, but it says nothing about permissions, that arbitrary shell execution is potentially destructive, how output/exit codes are returned, or what happens to processes left running.

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?

Two sentences, front-loaded with the core action and followed by the async-behavior caveat. The parenthetical is dense but earns its place by disambiguating execution environments.

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 six-parameter shell-execution tool with no annotations and no output schema, the definition covers environment routing and backgrounding but omits result handling, error behavior, and safety expectations. Adequate but with clear gaps given the tool's 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 six parameters are already documented. The description only adds the behavioral link between the wait threshold and backgrounding, which the schema hints at but does not explain; baseline 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 states a specific verb and resource ('Execute a shell command') and names the execution context ('active VS Code workspace'), with a parenthetical clarifying local vs. Remote-SSH/WSL shell integration. It stops short of explicitly differentiating from the sibling 'vscode_execute_command', leaving the agent to guess which one to prefer.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus the alternatives in the sibling set (e.g., vscode_execute_command, grep_search, list_dir). The mention of Remote-SSH/WSL windows describes where it runs, not when to choose it, and no exclusions or prerequisites are given.

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