Skip to main content
Glama

read_file

Read a remote file over SSH via SFTP, with automatic fallback to 'sudo cat' if permission is denied and sudo is configured.

Instructions

Read a remote file over SSH.

Attempts to read using SFTP first. If permission is denied and use_sudo is True or sudo_password is provided, falls back to using 'sudo cat' via shell command.

Args: host: Hostname, IP address, or SSH config alias remote_path: Path to the remote file username: SSH username (optional) password: SSH password (optional) key_filename: Path to SSH key file (optional) port: SSH port (optional) encoding: Text encoding (default: utf-8) errors: Error handling for decoding (default: replace) max_bytes: Maximum bytes to read (default: 2MB) sudo_password: Password for sudo (optional, not needed if NOPASSWD configured) use_sudo: Use sudo for reading (tries passwordless if no sudo_password provided)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
remote_pathYes
usernameNo
passwordNo
key_filenameNo
portNo
encodingNoutf-8
errorsNoreplace
max_bytesNo
sudo_passwordNo
use_sudoNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the dual read method (SFTP then sudo cat) and explains parameters like sudo_password and use_sudo. It could mention error handling, but the errors parameter is documented. Overall clear behavioral transparency.

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 concise, starting with a summary line and then listing parameters in a structured Args section. Every sentence adds value, no redundancy.

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 (11 parameters, output schema exists), the description covers behavior (SFTP/sudo fallback), edge cases (sudo passwordless), and parameter semantics. With output schema present, return values need not be detailed.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must explain all parameters. The Args section provides thorough explanation for all 11 parameters, including optional authentication, encoding, and sudo behavior, adding substantial meaning beyond 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?

The description clearly states 'Read a remote file over SSH' with a specific verb and resource. It further elaborates on fallback behavior (SFTP then sudo cat), distinguishing it from a simple read tool and from sibling 'write_file'.

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?

The description provides conditional usage guidance: attempts SFTP first, falls back to sudo if permissions denied and appropriate parameters set. It does not explicitly state when not to use or compare to other siblings, but the context is clear enough for the tool's purpose.

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/devnullvoid/mcp-ssh-session'

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