Skip to main content
Glama

write_file

Destructive

Create new files or fully overwrite existing ones, building parent folders as needed. Use apply_patch or edit_file for changes to existing files.

Instructions

Create or fully overwrite a file (parent folders are created). Prefer apply_patch/edit_file for changes to existing files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
checkNoRun compilers/linters on the changed files afterwards (default true)
contentYesComplete new file content
expectedSha256NoOptional optimistic precondition from file_info; refuse overwrite if the file changed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.4/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, so the safety profile is covered. The description adds genuinely new behavioral context – parent folders are auto-created and the operation is a full overwrite rather than a merge – though it doesn't say what happens on failure or how the SHA precondition rejection surfaces.

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?

Two tight sentences with zero waste; the destructive overwrite semantics are front-loaded and the alternative-tool guidance follows immediately.

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 write tool with destructive annotations, a fully-covered schema, and no output schema, the description covers what it must: overwrite semantics, side effects, and routing to safer alternatives. Only failure behavior is unstated, which is a minor gap.

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 100%, so all four parameters including check and expectedSha256 are documented in the schema itself. The description adds no parameter-level detail beyond the overwrite scope, which is the expected baseline when the schema does the work.

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+resource ('Create or fully overwrite a file') and clarifies scope with 'fully overwrite' plus the parent-folder side effect. It also names sibling alternatives, so an agent can distinguish it from apply_patch/edit_file without opening either schema.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'Prefer apply_patch/edit_file for changes to existing files,' giving both the preferred alternative and the condition that selects it. This is an explicit when-not-to-use statement.

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

Deploy Server

Other Tools