Skip to main content
Glama

write_file

Create or replace a text file in an unlocked Cryptomator vault, using a version check to avoid overwriting changes and enabling undo.

Instructions

Create a new text file, or replace a whole existing one, in an open vault that may be changed. To replace, pass the version read_file or file_info gave you: without it, or if the file changed since, nothing is written. To add to the end of a file use append_file; the parent folder must exist (make_folder). The old contents are kept, the change is logged, and undo or restore_version can take it back. Returns the new version and the change id; if the user asked to approve replacements, it may instead return a question for them.

Input Schema

NameRequiredDescriptionDefault
pathYesA path inside the vault, from its top, for example 'Taxes/2025/receipts.md'.
vaultYesThe vault's name, as listed by the vaults tool, for example 'Taxes'.
confirmNoLeave empty. Only pass the code a previous answer gave you, after the user agreed.
contentYesThe whole text the file should hold.
purposeYesA few words on why, shown to the user or kept in the vault's change log.
versionNoTo replace an existing file: the version read_file or file_info gave you. Leave empty for a new file.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.4
    • addedInput schema / properties / confirm / description
      Added value: +"Leave empty. Only pass the code a previous answer gave you, after the user agreed."
    • addedInput schema / properties / content / description
      Added value: +"The whole text the file should hold."
    • addedInput schema / properties / path / description
      Added value: +"A path inside the vault, from its top, for example 'Taxes/2025/receipts.md'."
    • addedInput schema / properties / purpose / description
      Added value: +"A few words on why, shown to the user or kept in the vault's change log."
    • addedInput schema / properties / vault / description
      Added value: +"The vault's name, as listed by the vaults tool, for example 'Taxes'."
    • addedInput schema / properties / version / description
      Added value: +"To replace an existing file: the version read_file or file_info gave you. Leave empty for a new file."
  2. First observedv0.1.3

TDQS

A4.9/5.0
Behavior5/5

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

Annotations only declare the coarse safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), and the description is consistent with them by explaining WHY it is non-destructive: old contents are kept, the change is logged, and undo/restore_version can revert it. It additionally discloses optimistic-concurrency behavior (stale version means no write) and an interactive confirmation path where a question may be returned instead.

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?

Front-loaded with the primary action, then prerequisites, then the alternative tool, then behavioral guarantees, then return shape. Nearly every sentence carries decision-relevant information with no filler.

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?

An output schema exists so return values need not be detailed, yet the description still summarizes them (new version and change id, or a confirmation question). Combined with the prerequisite and concurrency notes, nothing an agent needs to call this safely is missing.

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 coverage is 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: the version value must come from read_file or file_info and is mandatory for replacement, and the confirm code is tied to a user-approval flow ('if the user asked to approve replacements'). It does not elaborate on the required purpose field beyond what the schema says.

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?

The description states a precise verb-plus-resource ('Create a new text file, or replace a whole existing one') and scopes it to 'an open vault'. It explicitly distinguishes itself from the sibling append_file ('To add to the end of a file use append_file'), so an agent can route correctly without inspecting other schemas.

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 explicit when-to-use routing ('To add to the end of a file use append_file'), a hard prerequisite (parent folder must exist, pointing at make_folder), and a precondition for replacement (pass the version from read_file or file_info, otherwise nothing is written). Both alternatives and failure conditions are named.

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