Skip to main content
Glama

write_file

Destructive

Create a note or REPLACE its whole content (a short text erases the rest; pass base). To add, use append_file; to change one part, patch_file. To notify a person, write [@Name](mention:<id>) from who_sees.

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
baseNoWhen replacing: the version read_file printed. If the note changed since, you are told to re-read and merge.
pathYes
contentYes
overwriteNo
workspaceNoUsually OMIT: the path finds its brain. Pass it only when a reply asks (new or ambiguous branch), with the brain the user named (if unclear ASK): id, 'mine', or owner name/email. A brain where the branch does not exist is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / base / description
      Previous value: -"The note's version as printed at the end of read_file (an ISO timestamp). Pass it when replacing an existing note."New value: +"When replacing: the version read_file printed. If the note changed since, you are told to re-read and merge."
    • changedInput schema / properties / workspace / description
      Previous value: -"Brain to act on: its id, «mio» (yours), or the owner's name/email as shown by search. Usually OMIT it: a path that already lives in one brain is found there, for reads and writes alike. Pass it only when the tool tells you to (a NEW branch, or one that exists in several brains) — with the brain the user named; when they were not explicit ASK THEM. A brain where the branch does not exist is refused even if you name it."New value: +"Usually OMIT: the path finds its brain. Pass it only when a reply asks (new or ambiguous branch), with the brain the user named (if unclear ASK): id, 'mine', or owner name/email. A brain where the branch does not exist is refused."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is known; the description earns credit for adding the concrete consequence ("a short text erases the rest") and the concurrency guard (pass `base`, and if the note changed you are told to re-read and merge). It stops short of describing what a refusal or a successful write returns, but that gap is minor against the annotation coverage.

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 dense sentences: the destructive-replace warning is front-loaded, then the alternative routing, then the one non-obvious formatting fact. Nothing is repeated from the title or annotations.

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 a destructive, open-world write tool with no output schema and only 40% schema coverage, the description covers the two things an agent most needs: that content is replaced wholesale and how to avoid clobbering concurrent edits. The unexplained `overwrite` flag keeps it from being fully complete.

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 40%, so the description needs to compensate. It does add real meaning for `base` (the version read_file printed, plus the stale-write recovery loop) and for `content` (the `[@Name](mention:<id>)` syntax sourced from who_sees), but `overwrite`, `path`, and `workspace` get nothing beyond the schema – notably `overwrite` is left entirely unexplained for a destructive write tool.

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?

"Create a note or REPLACE its whole content" gives a specific verb pair and resource, and immediately distinguishes the tool's two modes. Sibling tools append_file and patch_file are named as the contrasting operations, so an agent can pick this one without opening any 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?

Explicit routing is provided: use append_file to add, patch_file to change one part, and this tool for whole-content replacement or creation. The parenthetical "a short text erases the rest; pass `base`" also tells the agent the precondition for safe use.

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