Skip to main content
Glama
fs-mcp-server

fs-mcp-server

by qsrahman

Write File

write_file
DestructiveIdempotent

Creates a file or completely overwrites one, including missing parent directories. Use for full-content writes; choose the edit tool to modify part of a file.

Instructions

Create a file or completely overwrite one, creating missing parent directories. Overwrites without warning; to change part of a file use the edit tool.

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
pathYesAbsolute path, or relative to the server's working directory.
contentYesThe complete new contents of the file, written as given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered structurally. The description still adds real value beyond that by warning "Overwrites without warning" and disclosing implicit parent-directory creation, a side effect the annotations do not encode. It does not state what is returned or any auth/permission requirements, so it is solid but not rich.

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 tight sentences with the destructive behavior and the alternate tool front-loaded; no filler. Slightly clipped phrasing ("creating missing parent directories" appended as a fragment) keeps it just short of ideal polish.

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

Completeness5/5

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

For a two-parameter, fully annotated write tool with no output schema, the description covers purpose, destructiveness, side effects, and the correct alternative. Nothing an agent needs in order to call it correctly is missing.

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 100%, so both parameters are already documented, giving a baseline of 3. The description implies content is a full replacement ("completely overwrite") which reinforces the schema's "complete new contents" note, but adds no syntax, encoding, or path semantics beyond it.

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 and resource ("Create a file or completely overwrite one") plus the notable side effect of creating missing parent directories, and explicitly contrasts itself with the edit tool. An agent can distinguish it from edit_file without opening either schema.

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 routing rule: use edit when changing part of a file, since this tool overwrites wholesale. This is clear when-to-use guidance with a named alternative, though it does not cover other substitution cases (e.g., reading or fetching remote content via read_file/fetch_url).

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