Skip to main content
Glama

Write or append to a file

write_file
Destructive

Create, overwrite, or append text files in allowed directories; automatically create parent folders and use atomic writes for overwrite mode.

Instructions

Create, overwrite or append to a text file inside an allowed directory. Writes are atomic for overwrite mode. Parent directories can be created automatically. Content is returned as a small JSON summary.

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path or path relative to $HOME.
appendNoAppend instead of overwriting. Default false.
contentYesFile content.
encodingNoEncoding of content. Default utf8. Use base64 for binary.
create_parentsNoCreate missing parent directories. Default true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, and the description reinforces this by flagging overwrite semantics without contradicting them. It adds genuinely non-structured context: atomic writes for overwrite mode, automatic parent directory creation, and that a small JSON summary is returned.

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?

Four short sentences with no filler, and the most important information (create/overwrite/append into an allowed directory) is front-loaded. Slightly episodic but every sentence carries 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 mutation tool with no output schema, the description covers the destructive overwrite behavior, atomicity, directory creation, and return shape. The main remaining gap is guidance on choosing it over edit_file.

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 all five parameters are already documented, and the description adds only a loose reference to parent directory creation. It contributes no syntax, defaults, or edge-case behavior beyond what the schema states.

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 names concrete verbs (create, overwrite, append) against a specific resource (text file) and adds a scoping constraint (inside an allowed directory). It does not differentiate from the closely related edit_file sibling, so an agent must still infer which write tool to pick.

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?

Usage is implied by 'create, overwrite or append' and the allowed-directory constraint, but there is no explicit when-to-use or when-not guidance. Nothing tells the agent to prefer edit_file for in-place changes or read_file/stat_path for verification.

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