Skip to main content
Glama

ssh_put_file

Destructive

Write or overwrite a file on a Linux host over SSH using an ephemeral credential; optionally send binary content as base64. Requires host file transfer enabled.

Instructions

Write a file on a Linux host via SSH with an ephemeral credential. Creates or OVERWRITES the destination file with the given content. Use content_base64=true for binary data (the content field is decoded before writing). REQUIRES allow_file_transfer=true on the host (see ssh_list_servers); if false DO NOT retry, the signer will reject it. The write runs as the host's configured SSH user (no sudo); the destination must be writable by that user. On a host with a command_policy and shell_parse (the default) the transfer command (cat > path) is ALWAYS denied — the policy parser rejects its file redirect and no allow pattern changes that; if the signer denies it DO NOT retry. Only hosts with shell_parse:false can allowlist it. Content is limited by the broker's file_transfer_max_bytes (default 512 KiB). The content's sha256 is recorded in the audit log.

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

Input Schema

NameRequiredDescriptionDefault
modeNooptional octal permissions to chmod after writing, e.g. 0644 or 0755
pathYesabsolute destination path on the host; the file is created or overwritten
serverYeslogical name of the target host (see ssh_list_servers)
contentYesfile content. Text as-is, or base64 with content_base64=true for binary data.
ttl_secondsNoephemeral certificate validity in seconds; omit to use the maximum allowed by the host policy
content_base64Noif true, content is base64-encoded and is decoded before writing (required for binary files)

Output Schema

NameRequiredDescriptionDefault
serialYesaudit identifier; ignore when reasoning about the result
sha256Yeshex sha256 of the written content, recorded in the audit log
warningsNoadvisory command-policy warnings
bytes_writtenYesnumber of bytes written to the remote file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.1.2
  2. Removedv3.0.1
  3. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description adds substantial behavior: writes run as the host's configured SSH user with no sudo, the destination must be writable by that user, content is capped by file_transfer_max_bytes (default 512 KiB), and the content sha256 is audited. It also explains the policy-parser denial mechanism so the agent can avoid futile retries.

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?

Front-loaded with the core action followed by prerequisites, failure modes, and limits in a logical order. It is dense and nearly every sentence carries operational value, though the repeated 'DO NOT retry' warnings and the confirmation that base64 is decoded (already in the schema) are mildly redundant.

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 destructive write tool with an output schema and full parameter documentation, the description covers permissions, size limits, policy incompatibilities, and auditability. Nothing an agent needs in order to call it correctly or avoid predictable failures appears to be missing.

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 six parameters are already documented, including content_base64 and mode. The description restates the base64 decoding behavior but adds no new meaning for ttl_seconds or mode, so it sits at the baseline for a fully documented 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 (write a file on a Linux host via SSH) and immediately clarifies the create-or-overwrite semantics. It is clearly distinguishable from ssh_get_file and ssh_execute without opening any schema.

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?

Gives explicit when-not conditions: requires allow_file_transfer=true on the host (with a pointer to ssh_list_servers), says DO NOT retry if the signer rejects it, and warns that hosts with command_policy + shell_parse will always deny the transfer command. The agent knows exactly when to call and when to abandon.

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