Skip to main content
Glama

write_file

Create, overwrite, or append UTF-8 content to a local text file at an absolute path, with missing parent directories created automatically.

Instructions

Create, overwrite, or append to a local text file (creates parent directories automatically).

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": {
      "filePath": "<filePath>",
      "content": "<content>"
    },
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
appendNo
contentYesUTF-8 content to write
filePathYesAbsolute file path

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose two useful traits, that existing content is destroyed on overwrite and that parent directories are created automatically. It omits what happens when append targets a non-existent file, encoding guarantees beyond the schema's UTF-8 note, and any permission or failure behavior.

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?

A single sentence front-loads the three write modes, with the directory-creation side effect tucked into a parenthetical. No filler, and the most decision-relevant information comes first.

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?

For a simple three-parameter tool with no annotations and no output schema, the description covers the core write semantics but says nothing about the return value or confirmation the caller gets. That gap matters because the agent has no output schema to fall back on.

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?

Schema coverage is 67%, and the append parameter has no schema description at all, so the description's 'or append to' is the only signal of what that flag changes. Combined with filePath's absolute-path note in the schema and the parent-directory behavior, the agent can map each parameter to a concrete effect.

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 uses specific verbs (create, overwrite, append) against a concrete resource (a local text file), which tells an agent exactly what the tool does. It doesn't name or contrast with the closest sibling, edit_file, so the agent must infer that this tool writes whole files rather than patching them.

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?

Usage is only implied: 'create, overwrite, or append' suggests when each mode applies, but there is no explicit guidance on choosing this over edit_file for modifications, and no stated prerequisites or exclusions. The agent gets a rough sense of fit but must infer the boundaries.

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