Run Shell Command
run_commandExecute shell commands with full piping and redirect support, capturing stdout, stderr, and exit code. Optionally specify a working directory.
Instructions
Run a shell command and return its stdout, stderr and exit code. Runs through the system shell, so pipes, redirects and globs work. Killed after the configured timeout.
WARNING: This executes arbitrary commands on the local machine. Only use commands the user would approve.
Args:
command (string): The shell command line to run.
cwd (string): Optional working directory.
Returns exit code plus captured stdout/stderr.
Example: { "command": "ls -la | head", "cwd": "~/project" }
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 |
|---|---|---|---|
| command | Yes | Shell command line | |
| cwd | No | Working directory |