Skip to main content
Glama

Patch SSH File

unfour.ssh.patch_file

Apply a small search-and-replace patch to a remote file over SSH and return a diff summary without exposing file contents; confirmation is required for risky paths or multiple matches.

Instructions

Applies a small search/replace patch to a remote file through SSH 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.

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.7/5.0
Behavior3/5

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

Annotations already declare openWorldHint=true, readOnlyHint=false and idempotentHint=false, so mutability and remote reach are known. The description meaningfully adds policy gating by environment, the confirmation requirement, and the diff-only return shape. It does not clarify how confirm relates to the two confirmation-text parameters or what happens when a patch is rejected mid-application; note that destructiveHint=false sits uneasily with editing a live remote file, but a targeted single-match replace is a reasonable read of that flag, so this is a tension rather than a contradiction.

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 filler. The core action and return shape lead, and the environment policy matrix follows immediately, so the most decision-relevant information is front-loaded.

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 return values need no elaboration, and the notable behavioral constraints (prod blocked, confirmation triggers) are present. However, for a 9-parameter mutation tool with zero schema description coverage, nearly half the parameters are undocumented anywhere, which is a real completeness gap.

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 description coverage is 0% across 9 parameters, so the description must carry the load. It covers search, replace and (implicitly) path and confirm, but leaves connectionId, workspaceId, timeoutMs and the duplicated confirmationText/confirmation_text pair completely unexplained — that duplication is exactly the kind of ambiguity a description should resolve.

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 resource: applies a search/replace patch to a remote file over SSH, and adds the scope qualifier 'small' plus a return contract (diff summary, no file content). This implicitly separates it from ssh.write_file and ssh.exec, but neither sibling is named, so an agent must infer the boundary rather than being routed explicitly.

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 environment rules are unusually concrete: dev permits single-match project-file patches, test/system paths/multi-match require confirmation, prod is blocked. That covers when-not-to-use and what triggers an extra step. It stops short of pointing to the alternative tool (write_file/exec) when a patch isn't appropriate, so a 4 rather than a 5.

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