Skip to main content
Glama

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

NameRequiredDescriptionDefault
localPathYesAbsolute path on this computer to write the file to.
overwriteNoReplace the local file if it exists. Defaults to false.
sessionIdYesThe sessionId returned by open_session.
remotePathYesPath on the server: absolute, relative to the session's current directory, or starting with ~/ for the login user's home.
descriptionNoOne 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.
timeoutSecondsNoHow long the transfer may take before it is aborted and any partial file removed. Defaults to 300; clamped to a maximum of 600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full load and does so: it discloses host access-policy checks, the POLICY_DENIED outcome, a possible pause for user approval, that bytes are not scanned for secrets, that existing local files are never replaced unless overwrite is true (DESTINATION_EXISTS), and that the local directory must pre-exist. It even states what is returned (resolved remote path, byte count, SHA-256).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action, followed by the 'use instead of' routing and then the behavioral caveats in descending order of importance. Every sentence carries a distinct constraint or outcome; nothing is redundant padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, and the description compensates by naming the return values. For a file-transfer tool with six parameters, it covers prerequisites, approval and denial behavior, overwrite safety, path requirements, and results — nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents each parameter and a baseline of 3 applies. The description adds meaning beyond it by explaining the overwrite guard's failure mode (DESTINATION_EXISTS) and the requirement that the local directory already exist, which constrains localPath in a way the schema does not state; timeoutSeconds is left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Downloads one regular file ... over SSH (SFTP)') plus the scope constraint that it works only through an already-open session. It also names the sibling that establishes the session (open_session) and explicitly carves out directory transfers, so an agent can distinguish this from upload_file or run_command without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit positive and negative guidance: use this instead of scp, sftp or rsync, and tar a directory on the server first rather than attempting a recursive fetch here. It also points to the prerequisite tool (open_session) for establishing the session, leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.