agent_execute_command
Execute shell commands and retrieve stdout, stderr, and exit code. Supports working directory, environment variables, and execution timeout.
Instructions
Execute a terminal command and return stdout, stderr, and exit code.
The command runs in a subprocess. By default it is executed through the system shell so that pipes, redirections, and environment variables work. Use caution with untrusted input to avoid command injection.
Args: command: Shell command to execute. working_directory: Working directory for the command. timeout: Maximum execution time in seconds. env: Additional environment variables to set or override. shell: Execute the command through the system shell.
Returns: str: JSON string with keys 'success', 'command', 'exit_code', 'stdout', 'stderr', and 'timed_out'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Additional environment variables to set or override. | |
| shell | No | Execute the command through the system shell (required for pipes/redirects). | |
| command | Yes | Shell command to execute. Pipes and redirections are supported. | |
| timeout | No | Maximum execution time in seconds. | |
| working_directory | No | Working directory for the command. Defaults to the server process cwd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |