Run Command
run_commandExecutes a shell command and waits for completion, returning exit code, stdout and stderr. Use it to run builds, tests or git commands remotely with optional cwd, env, stdin and timeout.
Instructions
Run a shell command and wait for it to finish. Returns exit code, stdout and stderr. For servers/watchers that never exit, use start_process instead.
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 folder, relative to the server root. Default = root. | |
| env | No | Extra environment variables. | |
| stdin | No | Text to pipe into the command's stdin. | |
| command | Yes | Shell command to run, e.g. 'npm install', 'pytest -q', 'git status && git diff'. | |
| timeout | No | Seconds before the command (and its children) are killed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||