execute_command
Execute shell commands with full control, capturing stdout, stderr, and return codes. Supports pipelines, redirections, and configurable timeouts.
Instructions
Execute an arbitrary shell command with full control over execution context.
This method allows running simple commands (e.g., ls, cat, echo, pwd, mv) as well as
complex shell pipelines and redirections (e.g., grep pattern file | sort > output.txt).
It captures both standard output and standard error, and returns structured results.
Args: command (str): Command to execute (any valid shell command) cwd (str, optional): Relative Working directory (defaults to data directory) timeout (int, optional): Command timeout in seconds
Returns: Result dictionary with stdout, stderr, and return code
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_command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | . | |
| command | Yes | ||
| timeout | No |