Skip to main content
Glama

Write files

fs_write
DestructiveIdempotent

Create or replace files in the project (parent directories are created). Give path and content for one file, or files: [{path, content}] for several at once. Use fs_edit to change part of an existing 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": {
      "project": "<project>"
    },
    "name": "fs_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoPath starting with "workspace/" (the code, /workspace) or "data/" (runtime files, /data).
filesNo
contentNo
projectYesProject slug or id.
idempotency_keyNoAny unique string; repeating a call with the same key does not repeat its effect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

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 genuine context beyond them: parent directories are auto-created, and replacement overwrites existing content. It omits the 5MB content cap and 100-file batch limit, though those live in the schema.

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?

Three short sentences, front-loaded with the core action, followed by invocation shapes and then the sibling redirect. No redundant wording or repetition of schema details.

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 5-parameter mutation tool with no output schema, the description covers what the tool does, both call shapes, and the key alternative tool. Return behavior is not described, but nothing needed to call it correctly is missing given the annotations already flag destructiveness and idempotency.

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?

With 60% schema coverage, the description carries useful load by explaining the alternative shapes (single file via path+content, or a files array of {path, content}), which the flat schema does not make obvious on its own. project and idempotency_key are left to their schema descriptions.

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 or replace files in the project") plus a scope detail (parent directories are created), and explicitly names fs_edit as the different sibling. An agent can distinguish it from fs_edit 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 a clear routing rule: use fs_edit to change part of an existing file, implying fs_write is for whole-file create/replace. It also clarifies the two invocation modes (single path+content vs files array). It stops short of explicit when-not-to-use cases such as bulk imports (fs_import) or read-before-write expectations.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources