Skip to main content
Glama

Write SSH File

unfour.ssh.write_file

Write or append UTF-8 content to a remote file over SFTP without a terminal or remote Python, using overwrite, append, or create modes.

Instructions

Writes or appends a remote file through SFTP. Content is limited to 4 MiB of UTF-8 bytes; no terminal session or remote Python is needed. Overwriting an existing file requires SFTP posix-rename@openssh.com v1; unsupported servers leave the original untouched. Failed or timed-out appends may be partial; inspect before retrying. Dev allows ordinary project paths; test and high-risk paths require confirmation; prod is blocked by policy. The returned result contains only path/mode/byte counts and command status, never file content.

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>",
      "content": "<content>"
    },
    "name": "unfour.ssh.write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo
pathYes
confirmNo
contentYes
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

A4.2/5.0
Behavior4/5

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

With annotations present, the description still adds substantial value: the 4 MiB UTF-8 limit, the posix-rename@openssh.com dependency for atomic overwrite with a defined fallback (original left untouched), and the warning that failed or timed-out appends may be partial. These are real behavioral traits the annotations do not convey, and nothing contradicts destructiveHint=false since the overwrite semantics are explicitly disclosed.

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?

Five tight sentences, each carrying a distinct fact, with the core operation and size limit front-loaded before caveats. Slightly dense and the environment-policy sentence packs three rules into one clause, but there is no filler.

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 mutating, policy-gated write tool, the description covers the limits, failure modes, confirmation requirements, and environment restrictions an agent needs before calling it. It also states that the result carries only path/mode/byte counts and never file content, resolving the main ambiguity an output schema alone might leave.

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 0%, so the description must compensate, and it does for content (4 MiB UTF-8 cap), the overwrite/append modes, timeout behavior, and the confirmation gating implied by the test/high-risk policy. It leaves workspaceId, connectionId, and the distinction between confirm, confirmationText, and confirmation_text unexplained, which is a notable residual gap across 9 parameters.

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 states a specific verb and resource ('Writes or appends a remote file') plus the transport ('through SFTP'), immediately distinguishing it from terminal-execution siblings like exec. The mode vocabulary (overwrite/append/create) and size ceiling make the scope unambiguous.

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?

It gives useful operating context — no terminal session or remote Python needed, prod blocked by policy, test/high-risk paths require confirmation — which implies when the tool is viable. However, it never explicitly routes the agent between overwrite, append, and create, nor names when a sibling such as patch_file would be the better choice.

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