Skip to main content
Glama
ssh-remote-mcp
by wcbup

Surgical Edit Remote File

ssh_edit
Destructive

Apply exact-match text replacements atomically to remote files over SSH, preserving permissions and line endings. Preview changes with a dry-run diff or guard against conflicts using a SHA-256 lock.

Instructions

Apply one or more exact-match text replacements atomically on a remote file, preserving original permissions and CRLF/LF line endings. Supports expected_sha256 optimistic concurrency lock and dry_run diff preview.

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": {
      "target": "<target>",
      "path": "<path>",
      "edits": "<edits>"
    },
    "name": "ssh_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesExplicit remote absolute path (e.g. /etc/nginx/nginx.conf or C:\Services\app.json) or home-relative ~/... path. Bare relative paths are rejected.
editsYesOrdered list of exact-match edits; all must succeed or nothing is written
targetYesSSH target as configured host alias, host, user@host, user@host:port, or [ipv6]:port. Never include remote paths in target.
dry_runNoPreview unified diff without writing to disk (default: false)
expected_sha256NoOptional SHA-256 from ssh_read; aborts with CONFLICT if file changed on server

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations: atomic all-or-nothing edits, preservation of permissions and CRLF/LF line endings, optimistic concurrency via expected_sha256, and dry-run diff preview. This gives the agent clear mutation and safety context for a destructive, non-idempotent operation.

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?

Two dense sentences with no wasted wording, front-loading the core operation and then the key safety mechanisms. Every clause contributes useful behavioral context.

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?

For a destructive remote mutation tool with full schema coverage and no output schema, the description covers the critical behaviors: atomicity, permission/line-ending preservation, concurrency conflict handling, and dry-run preview. No essential caller context appears missing.

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 coverage is 100%, so the input schema already documents all parameters including path restrictions, edit ordering, dry_run, and expected_sha256 conflict behavior. The description reinforces the concurrency-lock and diff-preview intent but adds little parameter-level 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?

States a specific verb and resource: exact-match text replacements on a remote file, applied atomically. The phrase "surgical edit" and exact-match semantics distinguish it behaviorally from whole-file tools like ssh_write.

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?

Implies use for precise replacements and mentions dry_run and expected_sha256 from ssh_read, but does not explicitly name when to prefer ssh_write or other alternatives, nor when not to use this tool.

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