Skip to main content
Glama

ssh_write_file

DestructiveIdempotent

Write text or binary content to a file on a remote SSH host using SFTP. Missing parent directories are created automatically.

Instructions

Write content to a file on a remote SSH host (create or overwrite).

Uses SFTP to transfer the content. Missing parent directories are created automatically. For binary content, base64-encode it and set encoding='base64'.

Args: alias: Host alias. remote_path: Absolute destination path on the remote host. content: Text to write. For binary content, encode as base64 and set encoding='base64'. encoding: 'utf-8' to write the content as text (default), 'base64' to decode first.

Returns: Success message with byte count, or an error description.

Examples: - Write a cron job: remote_path='/etc/cron.d/myjob', content='...' - Deploy a config: remote_path='/etc/myapp/config.yaml', content='...' - Write a script: remote_path='/usr/local/bin/deploy.sh', content='...'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasYes
remote_pathYes
contentYes
encodingNoutf-8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already indicate destructiveHint=true and idempotentHint=true. The description adds useful behavioral details: uses SFTP, automatically creates missing parent directories, and handles two encoding modes. This provides context beyond annotations without contradicting them.

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?

The description is well-organized: summary sentence, mechanism, args in list format, return type, and examples. All information is front-loaded and every sentence adds value, resulting in an efficient and readable definition.

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 tool's simplicity, the description covers all necessary aspects: purpose, parameters, encoding handling, return format, and examples. Combined with annotations and schema, an agent has sufficient information to invoke the tool correctly without ambiguity.

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 description coverage is 0%, so the description must carry the burden. It provides terse but sufficient descriptions for all four parameters (alias, remote_path, content, encoding) and clarifies the default encoding. While not exhaustive, it adds meaning beyond the schema itself.

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?

The description opens with a clear verb+resource statement: 'Write content to a file on a remote SSH host (create or overwrite).' This immediately distinguishes it from siblings like ssh_read_file (read) and ssh_download_file (download from remote), making the tool's unique role obvious.

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?

The description provides concrete examples (cron job, config, script) and explains how to handle binary content via base64 encoding. It does not explicitly contrast with similar tools like ssh_upload_file, which slightly reduces guidance, but the examples and encoding details still offer solid usage direction.

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

Install Server

Other Tools

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/muradmalik23/sshand'

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