Run a one-off command
terminal_runRun a short command in a fresh non-interactive shell, wait for completion, and return stdout, stderr, exit code, and duration when no persistent session state is needed.
Instructions
Run a command in a fresh non-interactive shell and wait for it to finish. Returns stdout, stderr, exit code and duration. Use this for short commands when no persistent session state is needed.
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": "terminal_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory. Defaults to the server working directory. | |
| shell | No | Shell executable. Defaults to $SHELL. | |
| command | Yes | Command line to execute. | |
| timeoutMs | No | Maximum time to wait in milliseconds. Default 120000 for terminal_exec, 15000 for terminal_write, 30000 for terminal_run. | |
| maxOutputChars | No | Cap on captured stdout and stderr characters. Default 200000. |