bash_exec
Execute a bash command and return its stdout, stderr, exit code, and execution duration.
Instructions
Execute a bash command and return stdout, stderr, exit code, and duration.
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": "bash_exec"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The bash command to execute | |
| cwd | No | Working directory (defaults to server's cwd) | |
| timeout | No | Timeout in seconds (default 30, max 600) | |
| env | No | Additional environment variables to set |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stdout | Yes | Command standard output | |
| stderr | Yes | Command standard error | |
| exit_code | Yes | Exit code (124 = timeout) | |
| duration_ms | Yes | Execution time in milliseconds |