Skip to main content
Glama
slepp
by slepp

ssh_edit

Replace exact text in a remote file over SSH in one round trip, with batched edits and exact matching to ensure only intended changes are applied.

Instructions

Replace exact text in an existing remote file over SSH — the remote counterpart of the local file-editing tool. Each edit's 'old_str' must match exactly one location in the file (as it stands after any earlier edits in the same call); ambiguous or missing matches fail without writing anything. Provide multiple {old_str, new_str} entries in 'edits' to batch several changes to the same file into a single read-then-write round trip instead of one SSH round trip per edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute (or login-directory-relative) remote path. Must already exist as a regular file.
portNo
editsYesOne or more replacements, applied in order against the file's current remote content.
targetYesOpenSSH target such as host, alias, or user@host.
timeoutNoLocal timeout in seconds.
identity_fileNo
extra_ssh_argsNoAdditional ssh(1) flags passed verbatim, e.g. ["-J", "jumphost"]. Prefer the dedicated port, identity_file, and strict_host_key_checking parameters.
known_hosts_fileNo
strict_host_key_checkingNoBoolean or one of yes, no, ask, accept-new, off.
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It transparently discloses critical behavior: each old_str must match exactly one location, edits are applied in order, and ambiguous or missing matches fail without writing anything. It also explains the read-then-write batching behavior, which is useful beyond the schema. It does not mention permissions or backup behavior, but the core mutation semantics are well disclosed.

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 three sentences long, front-loaded with the core action, and every sentence contributes: the first states purpose, the second explains safety guarantees, and the third gives batching rationale. There is no redundancy or filler.

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?

Given nine parameters, no annotations, and no output schema, the description covers the operation's main semantics well: exact matching, atomicity on failure, sequential edits, and batching efficiency. It does not describe return values or file permission implications, which are not strictly required but would round out completeness. Overall, it provides enough context for an agent to select and invoke the tool safely.

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 67%, leaving port, identity_file, and known_hosts_file undocumented. The description compensates by adding meaningful semantics to the 'edits' parameter: uniqueness requirement, sequential application, and batching benefit. It also adds guidance to prefer dedicated port/identity_file/strict_host_key_checking parameters over extra_ssh_args. This adds value beyond the schema, though some standard SSH parameters remain thin.

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 opens with a specific verb+resource: 'Replace exact text in an existing remote file over SSH', making the purpose unmistakable. It also distinguishes itself from siblings by labeling it the 'remote counterpart of the local file-editing tool,' which clearly separates it from other SSH operations like exec, scp, or view.

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 gives clear usage context: use for exact-text replacement in remote files and batch multiple edits to avoid multiple SSH round trips. It does not name explicit alternative tools for cases like fuzzy edits or complete file rewrites, but the guidance is otherwise clear and actionable.

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

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