Skip to main content
Glama

Write File

write_file

Creates or updates a plain UTF-8 text file at a given path with specified content, with an optional overwrite flag. Use it for text files only, not binary formats.

Instructions

Create or update a plain UTF-8 text file. For binary files (Excel, Word, PPTX, PDF, Images, Zip, SQLite), use their specific creation tools.

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
overwriteNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior2/5

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

With zero annotations, the description carries the full behavioral burden for a mutation tool, and it leaves the critical behavior unstated: the schema exposes an overwrite flag defaulting to false, implying that existing files are protected unless explicitly replaced, but the description never says what happens when the target path already exists or whether writes are refused, backed up, or silently clobbering. Permission requirements and failure modes are also absent.

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?

Two sentences, front-loaded with the primary capability and immediately followed by the exclusion. Nothing is padded or redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation, but for a destructive-by-nature file mutation with no annotations the definition should still disclose overwrite behavior and any safety guarantees. That gap is large relative to the tool's risk profile.

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 description must compensate, and it does not: path, content, and especially overwrite are never mentioned. The only signal added is that content is UTF-8 text, which is marginal against the unexplained overwrite default semantics.

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?

States a specific verb pair (create or update) and resource (plain UTF-8 text file), and explicitly carves out the binary-format territory owned by sibling tools like create_excel and create_pdf. An agent can tell from the description alone whether this tool is the right one.

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 an explicit when/when-not split: text files here, binary formats through their dedicated creation tools. Alternatives are named only by format category rather than by tool name, but the routing instruction is unambiguous for the common failure case of asking a text writer to emit XLSX/PDF.

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