Skip to main content
Glama
powershell-mcp
by IMRRD

sftp_download

Download files from a remote host to a Windows host over SFTP in-process using SSH2—no scp.exe or WSL. Supports key/password auth, host-key pins, timeouts, and verified staging.

Instructions

Download a file from a remote host to this Windows host over SFTP, in-process (ssh2 — no scp.exe, no WSL, headless).

Input Schema

NameRequiredDescriptionDefault
hostYesRemote host or IP.
portNoSSH port (default 22).
stagedNoOpt-in verified staging. Upload fails closed where atomic no-clobber is unsupported; download uses SHA-256 readback and atomic no-clobber hard link.
passwordNoPassword auth (used if no key).
usernameYesSSH username.
localPathYesDestination path on this Windows host.
timeoutMsNoHard timeout in ms (default 120000).
passphraseNoPassphrase for the private key, if any.
remotePathYesSource path on the remote host.
hostKeyPinsNoExplicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation.
credentialRefNoOperator-provisioned scoped credential reference, exclusive with raw auth.
privateKeyPathNoPath to a private key file on this Windows host.

Output Schema

NameRequiredDescriptionDefault
logNo
detailYes
stderrYes
stdoutYes
targetYes
exitCodeYes
timedOutYes
transportYes
durationMsYes
truncationYes
executionIdYes
errorRecordsNo
schemaVersionYes
terminationStatusYes
terminationCertaintyYes
errorRecordsTruncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.7.0
    • addedInput schema / properties / credentialRef
      Added value: +{
      +  "description": "Operator-provisioned scoped credential reference, exclusive with raw auth.",
      +  "type": "string"
      +}
    • addedInput schema / properties / hostKeyPins
      Added value: +{
      +  "description": "Explicit SHA256:base64 trusted host key fingerprints; multiple keys permit rotation.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / staged
      Added value: +{
      +  "description": "Opt-in verified staging. Upload fails closed where atomic no-clobber is unsupported; download uses SHA-256 readback and atomic no-clobber hard link.",
      +  "type": "boolean"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "detail": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "bytes": {
      +          "type": "number"
      +        },
      +        "cleanup": {
      +          "enum": [
      +            "not_needed",
      +            "removed",
      +            "failed",
      +            "unknown"
      +          ],
      +          "type": "string"
      +        },
      +        "direction": {
      +          "enum": [
      +            "upload",
      +            "download"
      +          ],
      +          "type": "string"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "finalized": {
      +          "type": "boolean"
      +        },
      +        "localExitCode": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "sha256": {
      +          "type": "string"
      +        },
      +        "shell": {
      +          "type": "string"
      +        },
      +        "signal": {
      +          "type": "string"
      +        },
      +        "verification": {
      +          "enum": [
      +            "not_started",
      +            "sha256_matched",
      +            "failed"
      +          ],
      +          "type": "string"
      +        },
      +        "version": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "durationMs": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "errorRecords": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "category": {
      +            "type": "string"
      +          },
      +          "exceptionType": {
      +            "type": "string"
      +          },
      +          "fullyQualifiedErrorId": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "category",
      +          "fullyQualifiedErrorId",
      +          "exceptionType",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "errorRecordsTruncated": {
      +      "type": "boolean"
      +    },
      +    "executionId": {
      +      "type": "string"
      +    },
      +    "exitCode": {
      +      "anyOf": [
      +        {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "log": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "complete": {
      +          "type": "boolean"
      +        },
      +        "expiresAt": {
      +          "type": "string"
      +        },
      +        "handle": {
      +          "type": "string"
      +        },
      +        "stderrBytes": {
      +          "type": "number"
      +        },
      +        "stdoutBytes": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "handle",
      +        "complete",
      +        "stdoutBytes",
      +        "stderrBytes",
      +        "expiresAt"
      +      ],
      +      "type": "object"
      +    },
      +    "schemaVersion": {
      +      "const": 1,
      +      "type": "number"
      +    },
      +    "stderr": {
      +      "type": "string"
      +    },
      +    "stdout": {
      +      "type": "string"
      +    },
      +    "target": {
      +      "type": "string"
      +    },
      +    "terminationCertainty": {
      +      "enum": [
      +        "unknown",
      +        "root_exited"
      +      ],
      +      "type": "string"
      +    },
      +    "terminationStatus": {
      +      "enum": [
      +        "completed",
      +        "nonzero_exit",
      +        "script_error",
      +        "remote_error",
      +        "timeout",
      +        "cancelled",
      +        "transport_error",
      +        "unknown"
      +      ],
      +      "type": "string"
      +    },
      +    "timedOut": {
      +      "type": "boolean"
      +    },
      +    "transport": {
      +      "enum": [
      +        "powershell",
      +        "program",
      +        "winrm",
      +        "ssh",
      +        "sftp"
      +      ],
      +      "type": "string"
      +    },
      +    "truncation": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "limitBytesPerStream": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "stderr": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "capturedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "observedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "omittedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "truncated": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "observedBytes",
      +            "capturedBytes",
      +            "omittedBytes",
      +            "truncated"
      +          ],
      +          "type": "object"
      +        },
      +        "stdout": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "capturedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "observedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "omittedBytes": {
      +              "minimum": 0,
      +              "type": "number"
      +            },
      +            "truncated": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "observedBytes",
      +            "capturedBytes",
      +            "omittedBytes",
      +            "truncated"
      +          ],
      +          "type": "object"
      +        },
      +        "truncated": {
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "truncated",
      +        "limitBytesPerStream"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "schemaVersion",
      +    "executionId",
      +    "transport",
      +    "target",
      +    "stdout",
      +    "stderr",
      +    "exitCode",
      +    "durationMs",
      +    "timedOut",
      +    "truncation",
      +    "terminationStatus",
      +    "terminationCertainty",
      +    "detail"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.5.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It usefully discloses that the transfer is in-process via ssh2 with no scp.exe or WSL dependency (relevant in a headless Windows environment), but says nothing about whether an existing local file at localPath is overwritten, whether the operation fails closed, or what auth is required. For a tool that writes to the local filesystem, the overwrite/clobber semantics are the critical missing disclosure.

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

Conciseness4/5

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

A single front-loaded sentence with no padding, and the parenthetical about ssh2/scp.exe/WSL is genuinely informative for an agent judging environment constraints. There is minor mojibake in the em-dash, and the sentence is arguably too short given the tool's complexity, but there is no bloat.

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

Completeness2/5

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

An output schema exists, so return values need no explanation, and the schema fully documents parameters. However, for a 12-parameter, no-annotation file-transfer tool, the description leaves auth selection (password vs privateKeyPath vs credentialRef), overwrite behavior, and staging trade-offs entirely to the schema, with no narrative on how the pieces fit together or when to prefer one auth path.

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

Parameters3/5

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

Schema description coverage is 100% across all 12 parameters, including auth modes, host key pinning, timeouts, and the 'staged' verification option, so the schema does the heavy lifting. The description adds no parameter-level meaning beyond what is already documented, which is the baseline case for a 3.

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

Purpose4/5

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

A specific verb plus resource ('Download a file from a remote host to this Windows host over SFTP') with an explicit direction, so an agent can distinguish it from the sibling sftp_upload without opening either schema. It does not name the sibling or any alternative tool, but the direction of transfer is unambiguous.

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

Usage Guidelines2/5

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

The description never states when to use this versus alternatives such as ssh_exec, run_powershell, or a batch tool, and offers no preconditions or exclusions. Usage is only inferable from the verb 'Download'.

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