Skip to main content
Glama

Write File

write_file

Creates or overwrites a UTF-8 text file at a given path with supplied content, letting an AI assistant save or update files on a Linux system.

Instructions

Create or overwrite a UTF-8 text file.

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 observedv0.2.1

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full behavioral burden. It does disclose two meaningful traits: the write is destructive to existing content ("overwrite") and the encoding is fixed at UTF-8. It omits other important behavior such as whether parent directories are created, whether the file is truncated in place, and what happens on permission or path errors.

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 short sentence with the destructive "overwrite" behavior front-loaded alongside the create case. Nothing is wasted, though the brevity comes partly from under-specification rather than disciplined editing.

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?

For a two-parameter, no-annotation, no-output-schema tool sitting among several overlapping write/edit siblings, this definition is too thin. It lacks sibling routing guidance and any error or path-resolution semantics that an agent needs to call it correctly the first time.

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 largely does not. It implies content is UTF-8 text, but never explains whether path is absolute or relative to a workspace root, nor gives any format examples for either required parameter.

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 overwrite") on a specific resource ("UTF-8 text file"), so the operation is immediately clear. It does not, however, distinguish itself from siblings such as edit_file and apply_patch, which also mutate file contents.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus edit_file, apply_patch, or move_file, and no statement about when it should not be used. An agent must infer that this is the whole-file write path from the verb "overwrite" alone.

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