Skip to main content
Glama

Write File

write_file

Overwrite a file with complete new content and automatically save its original version in memory the first time it is edited so changes can be reverted.

Instructions

Sobreescribe un archivo con contenido nuevo completo (no un diff, el archivo entero). Guarda automaticamente el contenido original en memoria la primera vez que se toca ese archivo, para poder revertir.

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
pathYes
contentYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.4/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 does add genuinely useful behavior: the overwrite is destructive and the original is snapshotted automatically only on the first touch of that file, which is a non-obvious constraint for later reverts. It omits failure modes, whether a non-existent path is created, and encoding handling, which matters for a write tool with zero annotation coverage.

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?

Two short sentences, front-loaded with the core action and the non-diff clarification. The parenthetical restates the same idea twice ("contenido nuevo completo" and "el archivo entero"), a minor redundancy, but nothing else is wasted.

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?

The tool is simple (2 required params) and an output schema exists, so return values need not be explained. Given the 0% schema coverage and absent annotations, though, an agent still lacks answers on path resolution and behavior when the target file does not exist.

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 0%, so both parameters are undocumented in structured data. The description does clarify the meaning of content (entire file body, not a patch), which is real added meaning, but path is left with no guidance on relative vs. absolute resolution or existence requirements.

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?

States a specific verb and resource (overwrite a file) and immediately disambiguates scope: it replaces the whole file, not a diff. That contrast is the key fact an agent needs to distinguish it from a partial-edit sibling, though it never names revert_file or a patch-style tool explicitly.

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

Usage Guidelines3/5

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

Implies the usage condition (full replacement vs. partial edit) and hints at a revert workflow by mentioning that the original is retained. However, it never tells the agent when to choose this over the sibling revert_file, nor what the prerequisites are (e.g., whether the file must already exist).

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