Skip to main content
Glama

write_file

Write a file's COMPLETE content, replacing whatever is there. Use this only to create a new file or to rewrite one from scratch. To change part of an existing file use edit_file, and to add to the end use append_to_file — rewriting a whole file to change a few lines makes every line show as modified in the diff, is charged for the unchanged content, and risks mistyping the parts you meant to keep. On session branches, successful writes create a pending review change that must be applied or discarded by the user.

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
project_idYes
descriptionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/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 discloses several non-obvious traits: full replacement semantics, the diff/cost/mistyping consequences of over-rewriting, and that session-branch writes create a pending review change needing apply/discard. It does not cover failure modes, permissions, or what happens to the file on a rejected review, leaving a modest gap.

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?

The verb and scope lead the paragraph, alternatives follow, and the rationale plus session-branch caveat close it. Every sentence carries distinct information with no restatement of the tool name or schema.

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 an output schema present, return values need not be explained, and the description covers purpose, selection rules, cost consequences, and session-branch review behavior. The remaining gap is parameter-level guidance for path/project_id/description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 4 parameters, so the description must compensate. It clarifies the semantics of 'content' (complete content, wholesale replacement), but says nothing about 'path' format, 'project_id', or the optional 'description' parameter, leaving three of four undocumented.

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?

The description states a specific verb and resource ('Write a file's COMPLETE content, replacing whatever is there') and immediately scopes it against siblings. An agent can distinguish it from edit_file and append_to_file without opening any 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?

It gives explicit when-to-use ('only to create a new file or to rewrite one from scratch') and names both alternatives with the condition that selects each ('To change part of an existing file use edit_file, and to add to the end use append_to_file'). Nothing about tool selection is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources