Skip to main content
Glama

sftp_write_safe

Write remote files atomically over SSH with automatic timestamped backups, returning unified diffs and SHA-256 hashes for verification and rollback.

Instructions

Safe atomic remote file write: creates automated remote backup (.matlock.bak.), writes atomically, and returns a unified diff patch and SHA-256 hashes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNoOptional SSH connection target. If omitted, uses default profile (homelab).
contentYesComplete content to write into file.
filePathYesAbsolute remote file path to write.
createBackupNoWhether to create .matlock.bak snapshot (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses the backup naming scheme (.matlock.bak.<timestamp>), that the write is atomic, and that the response includes a unified diff and SHA-256 hashes. It stops short of stating what happens when an existing backup is present, whether parent directories are created, or required permissions.

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?

A single dense sentence with the key value proposition ('Safe atomic') front-loaded and the three side effects listed after a colon. Zero filler, though the crammed list is slightly harder to parse than separate clauses would be.

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 mutation tool with no annotations and no output schema, the description covers the essential traits: it is destructive-ish (overwrites a remote file), it makes a timestamped backup, and it returns diff and SHA-256 evidence. Remaining gaps (error behavior on missing paths, directory permissions) are minor and mostly addressable by the required parameters.

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 description coverage is 100%, so every parameter including the nested target object is already documented, making 3 the baseline. The description's mention of backup creation and diff/hash output loosely relates to createBackup but adds no syntax or format detail beyond the schema.

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 ('atomic remote file write') and enumerates three concrete behaviors: backup creation, atomic write, and returning a diff plus SHA-256 hashes. It clearly separates this from sftp_read_file, but it never names or contrasts with the closest sibling, sftp_rollback_file, which is the natural pair for this operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The word 'Safe' hints at intent, but there is no explicit when-to-use guidance and no mention of alternatives such as ssh_exec or the relationship to sftp_rollback_file. An agent must infer that it should prefer this over writing a file via ssh_exec, and no exclusions or preconditions are given.

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