Skip to main content
Glama

write_file

Creates or safely replaces text files in an unlocked Cryptomator vault. Pass the last known version to block stale overwrites, keep old contents restorable, and log the reason for each change.

Instructions

Create a text file, or replace one. To replace, pass the version that read_file or file_info gave you; if the file changed since, nothing is written. The old contents are kept and the change can be undone. purpose: a few words on why (kept in the change log). confirm: only when a previous answer asked for it.

Input Schema

TableJSON 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

TableJSON 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.2/5.0
Behavior5/5

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

It discloses behavior beyond the annotations in two important ways: stale-write protection ("if the file changed since, nothing is written") and recoverability ("the old contents are kept and the change can be undone"), which reconciles the replace operation with destructiveHint=false. These are exactly the concurrency and reversibility traits an agent needs and that annotations alone can't convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The behavioral content is front-loaded and the sentences are dense with information. The trailing "purpose: ... confirm: ..." fragments read like schema notes grafted onto prose, which is slightly awkward, but nothing is redundant.

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?

With a 6-parameter schema at 100% coverage, full annotations, and an output schema, the description covers the key ambiguities: create vs replace, version conflict handling, and undo. It is complete enough to call correctly, with only the sibling-routing choice (vs append_file) left implicit.

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 real meaning by tying version to a specific source (read_file/file_info output) and explaining the purpose parameter's destination (change log). The confirm guidance also adds context beyond the field's default of empty.

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

Purpose4/5

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

"Create a text file, or replace one" is a specific verb+resource statement that implicitly separates this from the sibling append_file (append) and read_file (read). It doesn't explicitly name an alternative to contrast with, but the create-or-replace framing is unambiguous enough for an agent to pick the right tool.

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?

The description gives concrete usage rules for the two conditional parameters: pass version only to replace, sourced from read_file or file_info, and pass confirm only after a previous answer requested it. It doesn't cover when to choose this over append_file or move/copy_file, so it stops short of full routing guidance.

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