Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Stat a remote path

sftp_stat
Read-onlyIdempotent

Reads remote file or directory metadata over SFTP without reading file contents; optionally follows symbolic links to inspect the target.

Instructions

Reads remote file/directory metadata. Defaults to lstat without following symlinks; set followSymlink=true to read the link target. File contents are never read.

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": {
      "connectionId": "<connectionId>",
      "remotePath": "<remotePath>"
    },
    "name": "sftp_stat"
  }
}

Input Schema

NameRequiredDescriptionDefault
remotePathYes
connectionIdYes
followSymlinkNo
remotePathStyleNoUse windows when the remote is Windows OpenSSH; accepts a full drive path or a plain relative pathposix

Output Schema

NameRequiredDescriptionDefault
gidYes
uidYes
modeYes
noteNo
sizeYes
typeYes
atimeYes
mtimeYes
linkTargetNo
remotePathYes
followedSymlinkYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world behavior, yet the description still adds real value: it discloses that the default is lstat without symlink traversal, that followSymlink=true resolves the target, and that file contents are never read. The only missing piece is behavior on a nonexistent path or permission-denied errors.

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?

Three short clauses, each earning its place: purpose first, then the symlink default and its override, then the negative guarantee about contents. No filler or restatement of the title.

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

Completeness4/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-shape explanation is unnecessary, and the description covers the two behavioral questions an agent would actually have (symlink traversal and whether data is read). It is only slightly short of complete in leaving connectionId and path-resolution semantics to the schema.

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 only 25% — remotePathStyle is documented in the schema, but connectionId and remotePath carry no descriptions. The description compensates for the most consequential ambiguity by explaining followSymlink's default and effect, but says nothing about what connectionId refers to or how remotePath is interpreted relative to remotePathStyle.

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?

The description opens with a specific verb and resource ("Reads remote file/directory metadata"), which clearly separates a single-path stat from the sibling listing/download operations. It does not explicitly name sftp_list as the alternative for directory enumeration, so the differentiation is inferred rather than stated.

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

Usage Guidelines3/5

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

Usage context is implied by the tool's nature (inspect one path before downloading or uploading) but never stated. There is no explicit guidance on when to prefer this over sftp_list, nor any prerequisite such as needing an established connection via connectionId.

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