Skip to main content
Glama

write_file

Destructive

Write files to allowed paths, return a diff preview unless confirmed, and back up existing files before changes.

Instructions

Write a file in allowed paths. Without confirm=true it only returns the diff. Backs up first.

Input Schema

NameRequiredDescriptionDefault
pathYes
confirmNo
contentYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.2

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false; the description adds genuinely new behavior not in annotations: a dry-run diff mode gated on confirm, an automatic backup before writing, and a path allowlist restriction. It leaves open whether the backup happens during a preview-only call and whether an existing file is overwritten.

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?

Three short sentences, front-loaded with the action and scope, with the most consequential detail (confirm gate) stated before the secondary backup note. The telegraphic 'Backs up first.' is slightly clipped but wastes no space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, and the destructive-write safety story is partly covered. However, for a destructive filesystem mutation the description omits whether existing content is replaced, where the backup lands, and whether the path allowlist failure mode is an error or a silent miss.

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 0%, so the description must carry parameter meaning. It explains confirm well (gates the actual write vs. a diff preview) and hints at path constraints via 'allowed paths', but content is never described and the path allowlist rules are not spelled out.

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?

States a specific verb and resource ('Write a file') plus a scope constraint ('in allowed paths'), which is more than a restatement of the name. It does not differentiate from the sibling edit_file, so an agent must still infer whether to overwrite wholesale or make targeted edits.

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 clause 'Without confirm=true it only returns the diff' gives real invocation guidance: call without confirm to preview, with confirm to commit. There is no statement of when to prefer this over edit_file, nor any note about prerequisites for the target path, so guidance is 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.