ssh_cmd_history
Retrieve SSH command execution history with optional stdout and stderr snippets, filterable by pattern and ordered oldest or newest first.
Instructions
Retrieve command execution history with optional output snippets.
Returns: List of dictionaries containing command history, ordered from oldest to newest by default. Each entry contains: - id: Command handle ID - command: Executed command - exit_code: Exit status - start_time: Execution start timestamp - end_time: Execution end timestamp - origin: 'user' for a directly user-requested command, or an internal-plumbing label ('tool_internal', 'connection_probe', 'sudo_probe') for a helper command issued by another tool - parent_tool: Name of the MCP tool that triggered this command, when origin != 'user' - output: Stdout snippet (if include_output=True) - stderr is NOT included here, even for a failed command; see the separate 'stderr' field - stderr: Stderr snippet (if include_output=True) - often the more useful stream for a failed command; retrieved the same way ssh_cmd_output(stream='stderr') would
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of history entries to return | |
| pattern | No | Filter commands containing this pattern | |
| reverse | No | Return in reverse order (newest first) | |
| output_lines | No | Number of output lines to include (0 for none) | |
| include_output | No | Include command output snippets | |
| include_internal | No | Include internal/plumbing commands issued by other tools (e.g. ssh_file_write's sudo mv/chown/chmod dance, ssh_conn_connect's OS-detection probe, ssh_conn_verify_sudo's sudo check, ssh_dir_transfer's temp-archive handling). Set False to see only commands the user directly asked for via ssh_cmd_run/ssh_task_launch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |