Skip to main content
Glama

ssh_get_file

Read-only

Read a file from a Linux host over SSH using an ephemeral credential. Returns the content as text or base64, enforces a size limit, and logs the file's sha256.

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. 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.

Input Schema

TableJSON 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

TableJSON 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
Behavior5/5

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

The description adds substantial behavioral context beyond the readOnlyHint: base64 fallback for non-UTF-8, max_bytes error (not truncation), ephemeral credential, sha256 audit log entry, and no sudo. This fully discloses edge cases and operational implications.

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?

The description is information-dense and front-loaded with the primary purpose, followed by critical constraints and behavioral details. Every sentence adds value; there is no redundancy or filler.

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?

Given the tool's complexity (host prerequisites, output encoding, size limits, audit logging), the description covers all essential aspects: prerequisites, error conditions, output format, permissions, and audit. An output schema exists, so return-value details are unnecessary.

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?

The schema already covers all parameters with descriptions (100% coverage), including the max_bytes error behavior. The description reiterates the default and error semantics but does not add new parameter-level meaning beyond what the schema provides, so the baseline 3 applies.

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?

The description states 'Read a file from a Linux host via SSH with an ephemeral credential,' which is a specific verb+resource. It clearly distinguishes from sibling tools like ssh_put_file (write) and ssh_execute (execute commands) by focusing on reading file content.

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

Usage Guidelines4/5

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

It provides explicit usage conditions: REQUIRES allow_file_transfer=true and 'if false DO NOT retry.' It also mentions 'see ssh_list_servers' for checking and clarifies the read runs as the configured user with no sudo. However, it does not explicitly name alternative tools for file-reading vs command execution, so it stops short of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luisgf/infrabroker'

If you have feedback or need assistance with the MCP directory API, please join our Discord server