Skip to main content
Glama

Patch SSH File

unfour.ssh.patch_file

Applies a search-and-replace patch to a remote file over SSH and returns a diff summary without file content; confirmation is required for test/system or multi-match changes, and prod is blocked.

Instructions

Applies a search/replace patch through SSH stdin using Python 3 (4 MiB combined UTF-8 search/replace; 16 MiB target and result limit) and returns a diff summary without file content. Dev allows single-match project-file patches; test, system paths, or multi-match replacements require confirmation; prod is blocked by policy.

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": {
      "connectionId": "<connectionId>",
      "path": "<path>",
      "search": "<search>",
      "replace": "<replace>"
    },
    "name": "unfour.ssh.patch_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
searchYes
confirmNo
replaceYes
timeoutMsNo
workspaceIdNo
connectionIdYes
confirmationTextNo
confirmation_textNo

Output Schema

NameRequiredDescriptionDefault
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.0
    • addedOutput schema / properties
      Added value: +{
      +  "warnings": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  }
      +}
  2. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: explicit size ceilings (4 MiB combined search/replace, 16 MiB target/result), the SSH-stdin execution model, the confirmation gate, and that the response is a diff summary with no file content. There is mild tension with destructiveHint=false since the tool mutates file content, though the targeted search/replace nature and the confirmation requirements arguably support that annotation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler; every clause carries information about mechanism, limits, return shape, or policy gating. It is dense to the point of being a run-on, and the parenthetical limits interrupt the main flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the diff summary need not be detailed further, and the limits and policy gating are well covered. However, for a 9-parameter mutation tool with zero schema description coverage, the description leaves key inputs (connection targeting, timeout, and the redundant confirmation fields) unexplained, so an agent could not confidently populate the call.

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

Parameters2/5

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

Schema description coverage is 0% across 9 parameters, so the description carries the full burden and does not meet it. It implies meaning for path (system paths are gated) and for search/replace via the size limits, but says nothing about connectionId, workspaceId, timeoutMs, or the confusing near-duplicate confirm, confirmationText, and confirmation_text parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and mechanism: applies a search/replace patch over SSH stdin via Python 3, and clarifies it returns a diff summary rather than file content, which implicitly separates it from read_file. It never names a sibling outright (e.g., write_file for full rewrites), so an agent must infer the boundary between a targeted patch and a whole-file write.

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?

Gives concrete per-environment conditions: single-match project-file patches allowed in dev, test/system paths and multi-match replacements require confirmation, prod blocked by policy. That is unusually actionable guidance. It does not say what to do instead when blocked (e.g., use write_file or read_file), leaving the alternative path unnamed.

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

Deploy Server

Other Tools