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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | A path inside the vault, from its top, for example 'Taxes/2025/receipts.md'. | |
| vault | Yes | The vault's name, as listed by the vaults tool, for example 'Taxes'. | |
| confirm | No | Leave empty. Only pass the code a previous answer gave you, after the user agreed. | |
| content | Yes | The whole text the file should hold. | |
| purpose | Yes | A few words on why, shown to the user or kept in the vault's change log. | |
| version | No | To replace an existing file: the version read_file or file_info gave you. Leave empty for a new file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |