Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_file_write

Creates, overwrites, or appends remote files over SSH while handling special characters and multiline content; set permissions and create parent directories.

Instructions

Create a new file, or overwrite/append to an existing one, with the given content (works the same whether or not the file already exists - append=True on a nonexistent file just creates it). Handles special characters and multi-line content properly.

mode (Unix permission bits) is applied via a chmod command after writing - this only works on Linux/macOS. On Windows there's no equivalent, so mode is silently ignored there (same convention as ssh_dir_mkdir's mode parameter).

Returns: On success: {'success': True, 'file_path', 'bytes_written' (int), 'mode' (octal string, or None if not set OR if the connection is Windows - the response never echoes back a mode value that wasn't actually applied), 'append' (bool, echoes the parameter), 'connection'}. On failure (e.g. parent directory missing and create_dirs=False, write error): {'success': False, 'file_path', 'error'} - not a raised exception.

Long-running calls: if this takes longer than the server's wait cap (default 50s), it
returns {"status": "in_progress", "handle_id": ...} instead of the result - the work keeps
running. Get the result by polling ssh_cmd_check_status(handle_id=...), which returns this
tool's normal response once finished. Do not call it again meanwhile. Only one such
operation runs at a time; another one started meanwhile fails with a 'busy' error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoFile permissions to set after writing (octal, e.g. 0o644)
appendNoWhether to append to the file instead of overwriting
contentYesContent to write to the file
use_sudoNoUse sudo for the operation
file_pathYesPath to the file to write to
create_dirsNoCreate parent directories if they don't exist

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: mode is applied via chmod and silently ignored on Windows, failures return an object rather than raising, and long-running calls return an in_progress handle requiring polling. It even warns about the one-operation-at-a-time busy constraint.

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-loads the core action, then layers platform caveats, return shape, and async behavior in a logical order. The Returns block is long but each line carries real signal; minor overhead remains.

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 6-parameter mutation tool with no annotations, the description covers the mutation semantics, platform caveats, failure mode, and async handling. Complete enough that an agent can call and interpret it correctly.

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, but the description adds meaning beyond the schema: append=True on a nonexistent file just creates it, and mode only takes effect on Linux/macOS. use_sudo is left to its schema description, which is adequate.

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 a new file, or overwrite/append to an existing one') with clear scope, distinguishing it from read/replace-line siblings. The append-vs-overwrite semantics are spelled out so an agent knows exactly what calling it does.

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?

Gives useful operational guidance for the async case (poll ssh_cmd_check_status, don't re-call, busy error). But it never says when to choose this tool over siblings like ssh_file_transfer, ssh_file_replace_line, or ssh_file_copy. Usage is implied through behavior rather than an explicit selection rule.

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