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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"params": "<params>"
},
"name": "ssh_upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |