ssh_download_file
Download a file from a remote server to your local machine using SFTP. Specify the remote file path and local destination to transfer files securely.
Instructions
Download a file from the remote server to the local machine via SFTP.
This tool transfers a file from the connected SSH server to the local machine.
Args: params (DownloadFileInput): Validated input parameters containing: - session_id (str): SSH session identifier from ssh_connect - remote_path (str): Path to remote file to download (e.g., "/var/log/syslog") - local_path (str): Destination path for downloaded file (e.g., "./syslog", "/tmp/downloaded.log") - overwrite (bool): Overwrite local file if it exists, default False
Returns: str: Download confirmation with file size and paths
Examples: - Use when: "Download /var/log/syslog to local machine" -> params with remote_path="/var/log/syslog", local_path="./syslog" - Use when: "Get config file from server" -> params with remote_path="/etc/app/config", local_path="config" - Don't use when: Local file exists and overwrite=False - Don't use when: Need to download multiple files (call this tool multiple times)
Error Handling: - Returns "Error: Session not found" if session_id is invalid - Returns error if remote file doesn't exist - Returns error if local file exists and overwrite=False - Returns error if local directory doesn't have write permissions
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |