run_command
Runs a shell command in WSL and waits for completion, returning stdout, stderr, and exit code. Supports multi-line scripts, cwd, env vars, timeout, and guardrail blocking.
Instructions
Run a shell command in WSL (foreground, waits for completion). Supports multi-line scripts, cwd, env vars, and timeout. Returns stdout (and stderr, separately when separateStderr=true; otherwise stderr is merged into stdout) and exit code. Dangerous commands are blocked by the guardrail (confirm=true overrides confirmable ones).
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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (absolute POSIX or ~) | |
| env | No | Environment variables for this command only | |
| distro | No | ||
| command | Yes | The shell command(s) to run; may be multi-line | |
| confirm | No | Confirm a command flagged by the guardrail | |
| timeoutMs | No | Timeout in ms; default commandTimeoutMs | |
| binaryOutput | No | Return stdout/stderr as base64 instead of UTF-8 text | |
| separateStderr | No | Capture stderr separately (stderr field) instead of merging into stdout |