ssh_list_files
List files and directories in a remote directory over SSH, including size, type, and modification time. Supports showing hidden files and output in markdown or JSON.
Instructions
List files and directories in a remote directory via SFTP.
This tool provides a directory listing with file metadata including size, type, and modification time.
Args: params (ListFilesInput): Validated input parameters containing: - session_id (str): SSH session identifier from ssh_connect - remote_path (str): Path to remote directory to list (e.g., "/var/log", "~", "/tmp") - show_hidden (bool): Show hidden files (starting with .), default False - response_format (ResponseFormat): Output format (markdown or json)
Returns: str: Directory listing with file details
Examples: - Use when: "List files in /var/log" -> params with remote_path="/var/log" - Use when: "Show all files including hidden ones in home directory" -> params with remote_path="~", show_hidden=True - Use when: "Check what's in /tmp" -> params with remote_path="/tmp" - Don't use when: Need to list files on local machine (use local filesystem instead)
Error Handling: - Returns "Error: Session not found" if session_id is invalid - Returns error if remote directory doesn't exist - Returns error if directory is not readable due to permissions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |