Skip to main content
Glama

ssh_get_file

Read-only

Read a file from a Linux host over SSH using an ephemeral credential, returning text or base64 for non-UTF-8 content.

Instructions

Read a file from a Linux host via SSH with an ephemeral credential. Returns the content as text, or base64 (base64=true in the result) when the file is not valid UTF-8. REQUIRES allow_file_transfer=true on the host (see ssh_list_servers); if false DO NOT retry, the signer will reject it. The read runs as the host's configured SSH user (no sudo); the file must be readable by that user. On a host with a command_policy and shell_parse (the default) the transfer command (head -c N < path) is ALWAYS denied — the policy parser rejects its file redirect and no allow pattern changes that; if the signer denies it DO NOT retry. Only hosts with shell_parse:false can allowlist it. A file larger than max_bytes (default: the broker's file_transfer_max_bytes, 512 KiB) is an ERROR, not a truncation. The content's sha256 is recorded in the audit log.

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": {
      "server": "<server>",
      "path": "<path>"
    },
    "name": "ssh_get_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesabsolute path of the file to read on the host
serverYeslogical name of the target host (see ssh_list_servers)
max_bytesNoread at most this many bytes; a larger file is an error, not a truncation. Omit for the broker's configured limit.
ttl_secondsNoephemeral certificate validity in seconds; omit to use the maximum allowed by the host policy

Output Schema

NameRequiredDescriptionDefault
sizeYesfile size in bytes (decoded)
base64Yestrue when content is base64-encoded because the file is not valid UTF-8 text
serialYesaudit identifier; ignore when reasoning about the result
sha256Yeshex sha256 of the file content, recorded in the audit log
contentYesfile content: text as-is, or base64 when base64=true (binary file)
warningsNoadvisory command-policy warnings

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well past the readOnlyHint/idempotentHint annotations: it discloses the run-as user (host's configured SSH user, no sudo), the base64 fallback condition, that an oversized file is an ERROR rather than a truncation, the sha256 audit-log record, and two distinct denial modes that must not be retried. Nothing here contradicts readOnlyHint=true or idempotentHint=false.

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-loads what the tool does and the return encoding before any caveats, then layers preconditions and failure modes. Every sentence carries operational weight — no restatement of the name or filler — and the imperative 'DO NOT retry' phrasing is scannable.

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?

Although an output schema exists, the description still clarifies the base64 marker in the result, and it covers the prerequisites, permission model, size limit, and policy-denial cases that determine whether the call can succeed at all. For a 4-parameter read tool with this much host-policy nuance, nothing an agent needs 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 baseline is 3; the description adds real value by supplying the concrete default for max_bytes ('the broker's file_transfer_max_bytes, 512 KiB'), which the schema only gestures at, and by tying readability of `path` to the configured SSH user. ttl_seconds gets no treatment beyond the schema, keeping it short of a 5.

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 ('Read a file from a Linux host via SSH') plus the encoding behavior (text, or base64 when not valid UTF-8). This cleanly separates it from the write-side sibling ssh_put_file and from ssh_execute, so an agent can pick it without opening the 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 preconditions and hard stops: requires allow_file_transfer=true on the host (with a pointer to ssh_list_servers), and 'if false DO NOT retry, the signer will reject it.' It further spells out that hosts with command_policy+shell_parse always deny the head -c redirect and that only shell_parse:false hosts can allowlist it, which is exactly the when-not guidance an agent needs to avoid a retry loop.

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