execute_shell_command
Run shell commands locally with configurable working directory, shell, timeout, and background execution; capture truncated output for automation and system tasks.
Instructions
Execute a shell command in the foreground or background.
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": "execute_shell_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the command. If omitted, uses the server's current directory. | |
| shell | No | Shell executable to use, for example /bin/bash. Empty string means auto-detect. | |
| command | Yes | The shell command to execute. | |
| timeout | No | Timeout in seconds. If omitted, uses the server default. | |
| background | No | If true, run in the background and return a task_id immediately. | |
| output_truncation_mode | No | How to truncate oversized output: 'tail' keeps the end, 'head' keeps the beginning. If omitted, uses the server default. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |