Skip to main content
Glama

ssh_file_write

DestructiveIdempotent

Create or replace text files on a remote server over SSH, atomically writing each file with its own permissions, owner, and sudo access. Supports multiple files in a single call.

Instructions

Writes text files on a server, several in one call, each with its own path, permissions, owner and sudo. A file is replaced whole and never appears half-written; there is no append. For something that already exists on this machine, use ssh_upload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesOne file, or a list — mode and sudo decided per file, not per call.
profileYesMachine name.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
legendNoWhat the words in this answer mean. A key names the field before the value — "state=limited", "jobs[].state=lost" — and only the values this answer actually used are listed.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changedv2.3.3
    • changedInput schema / properties / files / oneOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "binary": {
      -        "description": "content is base64, decoded before writing. Default: false",
      -        "type": "boolean"
      -      },
      -      "content": {
      -        "description": "The whole new content, written byte for byte. Replaces the file, never extends it; no trailing newline is added.",
      -        "type": "string"
      -      },
      -      "mode": {
      -        "description": "Octal string, \"644\". Applied before the file takes its place.",
      -        "type": "string"
      -      },
      -      "path": {
      -        "description": "Where the file goes.",
      -        "type": "string"
      -      },
      -      "sudo": {
      -        "description": "Write as root — /etc and anywhere the profile user cannot write. Default: false",
      -        "type": "boolean"
      -      },
      -      "verify": {
      -        "description": "Compare sha256 before the file takes its place. Default: false",
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "path",
      -      "content"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "items": {
      -      "properties": {
      -        "binary": {
      -          "description": "content is base64, decoded before writing. Default: false",
      -          "type": "boolean"
      -        },
      -        "content": {
      -          "description": "The whole new content, written byte for byte. Replaces the file, never extends it; no trailing newline is added.",
      -          "type": "string"
      -        },
      -        "mode": {
      -          "description": "Octal string, \"644\". Applied before the file takes its place.",
      -          "type": "string"
      -        },
      -        "path": {
      -          "description": "Where the file goes.",
      -          "type": "string"
      -        },
      -        "sudo": {
      -          "description": "Write as root — /etc and anywhere the profile user cannot write. Default: false",
      -          "type": "boolean"
      -        },
      -        "verify": {
      -          "description": "Compare sha256 before the file takes its place. Default: false",
      -          "type": "boolean"
      -        }
      -      },
      -      "required": [
      -        "path",
      -        "content"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "binary": {
      +        "description": "content is base64, decoded before writing. Default: false",
      +        "type": "boolean"
      +      },
      +      "content": {
      +        "description": "The whole new content, written byte for byte. Replaces the file, never extends it; no trailing newline is added.",
      +        "type": "string"
      +      },
      +      "mode": {
      +        "description": "Octal string, \"644\", for this file alone. Applied before the file takes its place.",
      +        "type": "string"
      +      },
      +      "owner": {
      +        "description": "\"root:root\", for this file alone. Set before the file takes its place. Needs sudo; without it the answer says it was not applied.",
      +        "type": "string"
      +      },
      +      "path": {
      +        "description": "Where the file goes.",
      +        "type": "string"
      +      },
      +      "sudo": {
      +        "description": "Write as root, for this file alone — /etc and anywhere the profile user cannot write. Default: false",
      +        "type": "boolean"
      +      },
      +      "verify": {
      +        "description": "Compare sha256 before the file takes its place. A mismatch fails the call and leaves the path as it was. Default: true",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "path",
      +      "content"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "items": {
      +      "properties": {
      +        "binary": {
      +          "description": "content is base64, decoded before writing. Default: false",
      +          "type": "boolean"
      +        },
      +        "content": {
      +          "description": "The whole new content, written byte for byte. Replaces the file, never extends it; no trailing newline is added.",
      +          "type": "string"
      +        },
      +        "mode": {
      +          "description": "Octal string, \"644\", for this file alone. Applied before the file takes its place.",
      +          "type": "string"
      +        },
      +        "owner": {
      +          "description": "\"root:root\", for this file alone. Set before the file takes its place. Needs sudo; without it the answer says it was not applied.",
      +          "type": "string"
      +        },
      +        "path": {
      +          "description": "Where the file goes.",
      +          "type": "string"
      +        },
      +        "sudo": {
      +          "description": "Write as root, for this file alone — /etc and anywhere the profile user cannot write. Default: false",
      +          "type": "boolean"
      +        },
      +        "verify": {
      +          "description": "Compare sha256 before the file takes its place. A mismatch fails the call and leaves the path as it was. Default: true",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "path",
      +        "content"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +]
    • addedOutput schema / properties / files / items / properties / verified / description
      Added value: +"How the sha256 check ended, not whether the data landed — written says that. verified — sha256 was compared after the write and matched; mismatched — sha256 was compared and differed: nothing was replaced, and the path still holds what it held before; unavailable — the check had nothing to work with, and reason says what was missing; skipped — no comparison ran: none was asked for, or nothing landed to compare."
    • changedOutput schema / properties / files / items / properties / verified / enum
      Previous value: -[
      -  "verified",
      -  "unavailable",
      -  "skipped"
      -]New value: +[
      +  "verified",
      +  "mismatched",
      +  "unavailable",
      +  "skipped"
      +]
    • addedOutput schema / properties / files / items / properties / written / description
      Added value: +"Whether the data reached the path. Permissions and owner are a separate matter: one that did not apply is named in reason, and written stays true."
  2. Changed1 schema field changedv2.3.0
    • addedOutput schema / properties / legend / description
      Added value: +"What the words in this answer mean. A key names the field before the value — \"state=limited\", \"jobs[].state=lost\" — and only the values this answer actually used are listed."
  3. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the idempotent and destructive hints, the description discloses that files are replaced whole, atomically, and never appended to. This adds useful behavioral context that the annotations alone do not provide.

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 sentences, all high-signal: the core action, the atomic/replace behavior, and the sibling alternative. No filler or redundant restatement.

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?

Given the rich input schema, annotations, and output schema, the description covers the essential behavioral semantics and alternative routing. Nothing critical is missing for an agent to invoke this correctly.

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 100%, so the schema already explains each parameter thoroughly. The description contributes the multi-file and per-file ownership/sudo framing, but most parameter-level meaning is in the schema.

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?

States a specific verb and resource: writes files on a server. It also differentiates itself from the closest sibling by saying anything already on this machine should use ssh_upload.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly names ssh_upload as the alternative for files that already exist locally, and clarifies the tool supports multiple files in one call. The no-append note also sets an important boundary.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypnosis/ssh-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server