download_file
Download a single file from a remote server to your computer over an existing SSH/SFTP session, without scp or rsync. Returns byte count and SHA-256 for verification.
Instructions
Downloads one regular file from a remote server to this computer over SSH (SFTP), through an already-open session (see open_session). Use this instead of scp, sftp or rsync. To fetch a directory, tar it on the server first. The transfer is checked against the host's access policy and may be denied (POLICY_DENIED) or pause while the user is asked to approve it. The file's bytes are not scanned for secrets. An existing local file is never replaced unless overwrite is true (DESTINATION_EXISTS); the local directory must already exist. Returns the resolved remote path, the byte count and the SHA-256 of what was received.
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": {
"sessionId": "<sessionId>",
"localPath": "<localPath>",
"remotePath": "<remotePath>"
},
"name": "download_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| localPath | Yes | Absolute path on this computer to write the file to. | |
| overwrite | No | Replace the local file if it exists. Defaults to false. | |
| sessionId | Yes | The sessionId returned by open_session. | |
| remotePath | Yes | Path on the server: absolute, relative to the session's current directory, or starting with ~/ for the login user's home. | |
| description | No | One short sentence for the user: what this does and why. Shown in the approval window next to the exact command, which is what the user judges; it does not change what is allowed. Recommended for chained or long commands. | |
| timeoutSeconds | No | How long the transfer may take before it is aborted and any partial file removed. Defaults to 300; clamped to a maximum of 600. |