Skip to main content
Glama
finch-shell-mcp
by hlint

Write a whole file

fs_write
Destructive

Write text or hex data to a local file, create parent directories automatically, and verify the result by reading it back. Use hash checks to protect existing files from unintended overwrites.

Instructions

Provide exactly one of text or hex. A hex write to an existing file requires expect_hash unless force is set. The write is read back. Parent directories are created by default.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "fs_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
hexNohex
pathNopath
textNotext
forceNoforce
encodingNoencoding
preserveNo
create_dirsNocreate_dirs
expect_hashNoexpect_hash

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only say destructiveHint=true; the description adds real behavior: an optimistic-concurrency guard (expect_hash) that can be bypassed with force, automatic parent-directory creation, and read-back verification after the write. The notable omission is that it does not say existing file content is replaced/truncated, which is the core destructive consequence an agent needs to weigh.

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?

Four short sentences, front-loaded with the most binding constraint (text vs hex) before preconditions and defaults. No filler, no repetition of the schema.

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

Completeness4/5

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

For an 8-parameter destructive write with no output schema, the description covers the highest-risk semantics: input exclusivity, guard/override behavior, directory creation, and post-write verification. Gaps remain around encoding and the preserve nested options, though the latter are partly described in the schema.

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 descriptions are one-word restatements of names ("hex", "path", "force"), so the 88% coverage is nominal, not informative. The description compensates well by establishing mutual exclusivity of text/hex, the expect_hash precondition and force override, and the create_dirs default. It still says nothing about encoding or the preserve/bom/eol options.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description never states plainly that this writes/replaces an entire file; that comes from the title and the incidental phrase "A hex write to an existing file." It is clear enough that a write is happening, but it does not explicitly mark itself as the whole-file overwrite option versus siblings like fs_patch or fs_splice.

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?

It gives conditional guidance ("Provide exactly one of text or hex", hex writes to existing files need expect_hash unless force), which steers how to call it. It gives no when-to-use versus the sibling edit tools, so tool selection is left to inference from names.

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