Skip to main content
Glama

ssh_write_file

Destructive

Creates, overwrites, or appends text files on a remote host via SFTP, with optional directory creation and file permissions.

Instructions

Create/overwrite (or append to) a text file on the remote host via SFTP. mode is an octal string like "755". For root-owned paths use ssh_exec(command="tee /path >/dev/null", stdin=content, sudo=true) instead.

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>",
      "content": "<content>"
    },
    "name": "ssh_write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo
pathYes
appendNo
targetYes
contentYes
make_dirsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, but the description adds substantive context the annotations cannot: the write overwrites existing content by default, append is available to avoid that, and root-owned paths cannot be written directly so sudo via ssh_exec is required. It stops short of stating what happens on failure or partial writes.

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 short sentences, front-loaded with the core operation, followed by the encoding detail and the escape hatch for privileged paths. Every sentence carries information an agent needs.

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 not be explained, and the safety profile is covered by annotations plus the overwrite/append disclosure. However, with 0% schema coverage the description leaves `target` and `make_dirs` (default true, so directories may be created implicitly) unexplained, which matters for a destructive remote write.

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 0% across 6 parameters, so the description must compensate. It explains the non-obvious `mode` format (octal string like "755") and implies the semantics of append and content, but says nothing about `target` or `make_dirs`, leaving two parameters undocumented in both schema and description.

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?

The description opens with a specific verb and resource: create/overwrite a text file on the remote host via SFTP, and distinguishes overwrite from append with the parenthetical. It does not explicitly contrast with sibling ssh_upload, so the boundary between 'write text content' and 'upload a file' is left to inference.

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?

It gives a concrete condition and a named alternative: for root-owned paths use ssh_exec(command="tee /path >/dev/null", stdin=content, sudo=true) instead. That is real routing guidance, though it offers no guidance on choosing append versus overwrite or when to prefer ssh_upload.

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