Skip to main content
Glama

write_file

Destructive

Create or replace a UTF-8 text file within an allowlisted development folder, letting AI assistants write or overwrite project files safely at a specified path.

Instructions

Create or replace a UTF-8 text file inside an allowlisted development folder.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior4/5

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

The annotations already declare the destructive, non-idempotent, closed-world write profile, so the bar is lower, and the description still adds real context: "replace" signals that existing content is overwritten rather than appended, "UTF-8 text" rules out binary, and the allowlist constraint bounds where writes can land. It omits failure behavior, whether missing parent directories are created, and what happens when content exceeds the size limit.

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?

A single front-loaded sentence with no filler, and the destructive overwrite verb appears first where it matters most. It is efficient, though the brevity borders on under-specification for a write tool.

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?

With only two parameters and no output schema, a one-sentence definition could be adequate, but important call-time questions remain unanswered: path resolution rules, size limits, and whether a write returns anything the agent can verify. It covers the shape of the operation but not enough to call it confidently on edge cases.

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% for two required parameters, so the description carries the full burden of explaining them and largely fails. It never clarifies whether "path" is relative to the allowlisted root or absolute, nor does it mention the 2,000,000-character ceiling or any encoding-validation behavior for "content".

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 pair ("create or replace") and a specific resource ("UTF-8 text file"), so an agent knows exactly what call it is making. It does not, however, distinguish itself from sibling tools like patch_file or read_file, so the agent must infer that this is the whole-file write path rather than an edit-in-place path.

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?

"Create or replace" implies the overwrite use case and the phrase "inside an allowlisted development folder" implies a scope restriction, which is decent implied guidance. There is no explicit when-to-use versus when-not-to-use statement and no mention of patch_file as the alternative for partial edits, leaving the agent to infer the split.

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