Skip to main content
Glama

file_write

Writes content verbatim to a remote file, backing up and atomically replacing existing files on overwrite or appending to the end.

Instructions

Write content to a remote file verbatim (no escaping). overwrite first backs up the old file to ~/ops-backups/-auto/, then replaces it atomically, keeping mode and owner; append adds to the end.

Input Schema

NameRequiredDescriptionDefault
hostYes
modeNooverwrite
pathYesAbsolute remote path
backupNoBack up before overwrite
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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 burden and does most of it well: it discloses the backup location (~/ops-backups/<date>-auto/), atomic replacement, preserved mode and owner, and that append appends rather than replaces. Missing are prerequisite/privilege requirements on the remote host and failure behavior — the main remaining gaps for an unannotated mutation tool.

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?

A single dense sentence with the core write guarantee front-loaded, followed by the mode-specific behavior. No filler, and each clause adds operational information.

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 annotations and no output schema, the description covers the risky parts (backup, atomicity, permissions preservation) well. It stops short of explaining the host parameter and error/return behavior, which an agent would still need to guess at.

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 only 40%, so the description must compensate. It does explain mode values and the backup-before-overwrite behavior, and clarifies that content is written without escaping, but it says nothing about the 'host' parameter (SSH target? inventory name?) or path semantics, leaving two undocumented params unaccounted for.

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 content to a remote file') plus a distinctive behavioral qualifier ('verbatim, no escaping') that separates it from shell-based alternatives like exec. An agent can tell immediately this is a direct remote file writer.

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?

The description implicitly tells you to pick overwrite vs append, and the existence of file_read and backup_file siblings implies the read/backup split. But it never states when to prefer this over exec or whether it should be used for new files, so usage is only implied rather than explicit.

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