Skip to main content
Glama
mcp-ssh-persistent

mcp-ssh-persistent

by vivusk

ssh_write_remote_file

Write remote files over SFTP atomically: create a temp file in the same directory, preserve existing permissions and ownership, then rename over the target, with an in-place fallback if needed.

Instructions

Write content to a remote file via SFTP (no shell escaping). Atomic: writes a temp file in the same dir, keeps the existing file mode/owner, then renames over the target. Falls back to an in-place write (with a warning) when the dir is not writable.

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": {
      "server": "<server>",
      "remote_path": "<remote_path>",
      "content": "<content>"
    },
    "name": "ssh_write_remote_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoOptional octal mode, e.g. "600" (default: existing file mode, else 644)
serverYesServer alias from config.json (case-insensitive). Known aliases: (none configured)
contentYesFile content (UTF-8 text)
remote_pathYesRemote file path to write

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses atomicity mechanics (temp file in the same dir, preserve mode/owner, rename over target) and a notable failure mode (in-place fallback with a warning, when the directory is not writable). It omits what the warning looks like in the response and any permission/auth requirements for the write.

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?

Three dense sentences with the core action and mechanism front-loaded, then behavior, then edge case. Every sentence adds new information and nothing is repeated.

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?

For a mutation tool with no annotations and no output schema, the description covers mechanism, atomicity, and degradation behavior well. The main remaining gap is return/error semantics — what a successful write returns and how the non-writable-directory warning is surfaced to the caller.

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 schema already documents server, remote_path, content, and mode including the mode default. The description adds only indirect meaning for mode via 'keeps the existing file mode/owner', which is already reflected in the schema default text. Baseline 3 applies.

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 ('write content to a remote file') plus the mechanism ('via SFTP, no shell escaping'), which implicitly separates it from shell-based or upload-style siblings. It stops short of naming an actual alternative, so the differentiation is inferred rather than explicit.

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?

Use is only implied: writing text content to a remote path. There is no stated when-to-use versus ssh_upload or ssh_stream_write, and no prerequisites such as an established connection or auth state. The '(no shell escaping)' note hints at the boundary with exec-style writes but never spells it out.

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