Skip to main content
Glama

sftp_write

DestructiveIdempotent

Create or overwrite a text file on one of your servers over SFTP. 'content' is written as UTF-8. Folders on the way that don't exist yet are created (pass create_dirs: false to refuse instead), on Linux, macOS and Windows servers (C:/path/file or C:\path\file). Capped at 512 KB; for binary uploads use a terminal/scp 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": {
      "host": "<host>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "sftp_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesServer id from hosts_list
pathYesDestination file path (created or overwritten)
contentYesUTF-8 text to write
usernameNoLogin user (defaults to the tunnel's user, else root)
create_dirsNoCreate missing parent folders first (default true). With false, a missing folder is reported by name and nothing is written.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / create_dirs
      Added value: +{
      +  "description": "Create missing parent folders first (default true). With false, a missing folder is reported by name and nothing is written.",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint and idempotentHint, and the description goes further: it discloses that existing files are overwritten, that content is UTF-8, that missing parent folders are created unless create_dirs is false, and a hard 512 KB cap. These are real operational constraints not derivable from the annotations.

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, then constraints, then the alternative. No filler or restatement of the tool name.

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 five-parameter mutation tool with no output schema, the description covers overwrite semantics, encoding, directory creation, size limits and OS path formats. It does not describe what is returned on success (e.g., bytes written or final path), which is a minor gap.

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 100%, so baseline is 3. The description still adds value by explaining path syntax across platforms (C:/path/file or C:\path\file) and restating that create_dirs:false causes a named error with nothing written, which clarifies actual behavior rather than repeating the field label.

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 ("Create or overwrite a text file ... over SFTP") with scope details (UTF-8, 512 KB cap). It explicitly distinguishes itself from the binary-upload path ("for binary uploads use a terminal/scp instead"), so an agent can separate it from ssh_exec without opening a schema.

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?

Gives a clear use condition and names an alternative for the excluded case (binary uploads -> terminal/scp). It does not say when to prefer sftp_read or how it relates to other siblings, but the key routing decision is covered.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.