Skip to main content
Glama
N0moreher0
by N0moreher0

Write file

project_write_file
Destructive

Create, overwrite, or append files inside the workspace, with directory creation and checksum verification. Use it to write full file contents; edit small sections with project_edit_file instead.

Instructions

Write a file. mode=create errors if it exists; overwrite replaces; append concatenates to the end. Use when: create a new file or replace/append a file's contents. Avoid when: only a small section needs to change (project_edit_file) to leave the rest intact. Speed: fast; clears the read/list/search cache for the affected path. Output: file_written: action, bytes_written, sha256_after. Batch-safe: no

Input Schema

NameRequiredDescriptionDefault
modeNo
contentYes
create_dirsNo
relative_pathYesPath inside the workspace (relative, or absolute inside the workspace)
expected_sha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and non-idempotent, so the safety profile is covered; the description adds value beyond that with the cache invalidation side effect ("clears the read/list/search cache for the affected path"), the error behavior of mode=create, and the return payload (action, bytes_written, sha256_after). It also flags "Batch-safe: no", which prevents an agent from looping this in a batch call.

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?

Telegraphic, front-loaded lines with labeled sections (Use when / Avoid when / Speed / Output / Batch-safe) and zero filler. Every line carries actionable information an agent could act on.

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?

No output schema exists, but the description supplies the return shape and the cache side effect, so the main behavioral unknowns are covered. The gap is expected_sha256 and create_dirs, which matter for a destructive write tool with 20% schema coverage.

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 only 20%, so the description must compensate: it does explain the mode enum thoroughly (create errors if exists, overwrite replaces, append concatenates), which is the highest-risk parameter. However, create_dirs and especially expected_sha256 (an optimistic-concurrency guard) get no explanation anywhere, so compensation is partial.

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?

"Write a file" pairs a specific verb with a specific resource, and the three mode semantics (create/overwrite/append) are spelled out so the agent knows exactly which variant of writing it is choosing. It also implicitly separates itself from project_edit_file, which appears in the same toolset.

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?

Explicit "Use when: create a new file or replace/append a file's contents" and "Avoid when: only a small section needs to change (project_edit_file)" names the alternative and the condition that selects it. This is the strongest possible routing guidance.

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