Skip to main content
Glama

write_file

Create a new file or completely overwrite an existing one with new content, automatically generating any missing parent directories. Use it to save code, docs, or config files to a specified path.

Instructions

Create or completely overwrite a file with new content. Creates parent directories if needed.

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.3

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full disclosure burden. It usefully states that existing content is completely overwritten and that parent directories are created, but it omits permission requirements, error behavior, encoding assumptions, and return semantics.

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 description is two short sentences with no wasted words, and the key behavior—overwrite plus parent-directory creation—is front-loaded.

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?

For a two-parameter mutation tool with no annotations, no output schema, and 0% schema description coverage, the description covers the essential operation and directory behavior. It is still missing enough safety and return-context detail for a fully complete definition.

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%, so the schema provides only parameter names and types. The description mentions 'file' and 'content' but does not clarify path format, whether content is raw text, encoding, or how existing file content is replaced.

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 gives a specific verb and resource: create or completely overwrite a file with new content. It also notes parent-directory creation. It does not explicitly distinguish itself from sibling tools like create_file or edit_file, so it falls short of a 5.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool instead of edit_file, create_file, or read_file. The phrase 'completely overwrite' hints that it is not for partial edits, but the agent must infer that from the wording.

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