Skip to main content
Glama

Write file

write_file
DestructiveIdempotent

Create or overwrite UTF-8 files atomically via temp file and rename to prevent partial writes; optionally enforce SHA-256 checks and preview changes with dry-run.

Instructions

Write a UTF-8 text file on this computer ATOMICALLY (temp file + rename, so a dropped connection never leaves a half-written file). Creates or overwrites the file. Pass expectedSha256 (from read_file) to refuse the write if the file changed meanwhile — this prevents silently overwriting work done by another agent in parallel. The previous version is kept in ZeroIDE history (not next to the file), so the owner can undo the change in Settings → Changes; backup=false skips that. Use dryRun=true to preview a diff without writing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoShort human-readable explanation (1 line, in the user's language) of what you are about to do and why. Shown to the user on the approval card. Always provide when calling mutating tools.
pathYes
agentNoShort consistent identifier or display name of this agent (e.g. 'Claude · Лендинг', 'Тесты', 'Мой агент'). Used to separate tasks and route tray messages when multiple agents work in parallel.
backupNo
dryRunNo
contentYes
requestIdNo
expectedSha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Adds substantial behavior the annotations cannot convey: the atomic temp-file-plus-rename mechanism and why it matters, that history lives in ZeroIDE Settings → Changes rather than beside the file, that the change is undoable, and that expectedSha256 causes an outright refusal on conflict. This is consistent with destructiveHint=true and idempotentHint=true and explains what actually gets destroyed and how to recover.

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?

The most important trait, atomicity, is front-loaded and the rest proceeds from core behavior to safety options. A few parentheticals such as "(temp file + rename, so a dropped connection never leaves a half-written file)" are longer than needed, but each clause contributes 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 destructive, 8-parameter write tool with no output schema and thin schema coverage, the description covers the decisive behaviors: overwrite semantics, conflict protection, undo path, and preview mode. Gaps remain around requestId, failure/return behavior, and any size or encoding limits, which are minor relative to what is covered.

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

Parameters4/5

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

With only 25% schema description coverage across 8 parameters, the description carries real weight by explaining the semantics of expectedSha256 (conflict refusal), backup (history retention), and dryRun (diff preview) beyond what the bare schema offers. path, content, and requestId remain undocumented, though the first two are self-evident from their names.

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?

"Write a UTF-8 text file on this computer ATOMICALLY" names a specific verb and resource, and "Creates or overwrites the file" pins down the whole-file semantics that separate it from an in-place edit tool. It stops short of naming edit_file as the alternative, so sibling differentiation is implied rather than stated.

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

Usage Guidelines4/5

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

Gives clear conditional guidance on the optional behaviors: pass expectedSha256 to avoid clobbering parallel work, dryRun=true to preview a diff, backup=false to skip history. It does not say when to choose this over edit_file or file_ops, so the routing decision 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.