Skip to main content
Glama
fs-mcp-server

fs-mcp-server

by qsrahman

Write File

write_file
DestructiveIdempotent

Create a new file or fully overwrite an existing one, automatically creating any missing parent directories. Use it for whole-file writes; to change part of an existing file, use the edit tool instead.

Instructions

Create a new file or completely overwrite an existing file, creating any missing parent directories. Overwrites without warning; to change part of an existing file use edit_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
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/5.0
Behavior4/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. The description adds real value beyond them by warning that overwrite happens without warning and that missing parent directories are created as a side effect. It stops short of describing error behavior or what is returned, which keeps it at 4.

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 tightly written sentences with the destructive behavior front-loaded and the alternative named last. No sentence is redundant.

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 write tool with full schema coverage, complete annotations, and no output schema, nothing an agent needs to invoke it correctly is missing. The overwrite semantics and the edit_file alternative close the main risk points.

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 coverage is 100%, and the schema already explains that path may be absolute or relative and that content is the complete new contents. The description's phrase "written as given" restates rather than extends the schema, so the baseline 3 applies.

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 (create/overwrite) and resource (file) plus the side effect of creating missing parent directories, and explicitly names the sibling it is not (edit_file). 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 Guidelines5/5

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

Gives an explicit when-to-use-this-else condition: use this to create or fully replace, use edit_file to change part of an existing file. That is a direct routing rule to the most plausible alternative.

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