Skip to main content
Glama

Write a remote file

ssh_write_file
DestructiveIdempotent

Create or replace a full text file on a remote host over SFTP while preserving existing permission bits; the parent directory must already exist.

Instructions

Creates or replaces a text file on a host over SFTP. The whole file is replaced with content. An existing file keeps its permission bits. The parent directory must exist.

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

Input Schema

NameRequiredDescriptionDefault
hostYesName of a configured host, as returned by ssh_list_hosts
pathYesAbsolute path, or one relative to the login directory
contentYesFull new contents of the file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-dev.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag destructiveHint and idempotentHint, and the description adds real context beyond them: full-file replacement semantics, preservation of existing permission bits, and the requirement that the parent directory exist. It still omits what permissions a newly created file gets and what the call returns.

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?

Four short sentences, front-loaded with the core action, and each one carries a distinct operational fact (replacement, permission preservation, prerequisite). No filler or redundancy.

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 three-parameter write tool with annotations but no output schema, the description covers mutation semantics, prerequisites, and side effects on permissions. Only return behavior and encoding/new-file permission defaults are left unaddressed, which are minor gaps.

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 all three parameters are already documented, including host lookup via ssh_list_hosts and path relativity. The description only reinforces the meaning of 'content' as the complete new file body, adding little beyond the schema baseline.

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 states a specific verb and resource ('Creates or replaces a text file') plus the transport ('over SFTP'), which clearly separates it from read/list/exec siblings. It stops short of naming an alternative, so differentiation is inferred rather than stated.

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?

Usage is only implied by 'creates or replaces' and the parent-directory prerequisite. There is no explicit guidance on when to prefer this over ssh_exec for writing content, nor any note on when not to use it.

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