ssh_upload_file
Upload a local file to a remote server via SFTP. Specify local path, remote path, and file permissions.
Instructions
Upload a local file to the remote server via SFTP.
This tool transfers a file from the local machine to the connected SSH server.
Args: params (UploadFileInput): Validated input parameters containing: - session_id (str): SSH session identifier from ssh_connect - local_path (str): Path to local file to upload (e.g., "./config.json", "/tmp/data.csv") - remote_path (str): Destination path on remote server (e.g., "/tmp/config.json", "~/mydata.csv") - file_mode (int): File permissions in octal, default 0o644 (rw-r--r--)
Returns: str: Upload confirmation with file size and paths
Examples: - Use when: "Upload config.json to /tmp/" -> params with local_path="./config.json", remote_path="/tmp/config.json" - Use when: "Transfer script to home directory" -> params with local_path="script.sh", remote_path="~/script.sh" - Don't use when: Remote file already exists (use ssh_execute with rm first or set file_mode accordingly) - Don't use when: Need to upload multiple files (call this tool multiple times)
Error Handling: - Returns "Error: Session not found" if session_id is invalid - Returns error if local file doesn't exist - Returns error if remote directory doesn't have write permissions - Returns error if file size is too large for available bandwidth
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |