write_file
Write or update a Markdown note with YAML metadata, optionally preserving existing body via content lock. Validates parent links and syncs metadata before saving.
Instructions
Create or replace one Markdown note with YAML metadata. Use it when an agent has an explicit final content body and metadata to save. This is a destructive write: it replaces the complete file, unless content_lock=true is used to preserve the existing body and update only metadata. Before writing, the server validates that parent links do not create graph cycles, syncs parents and parents_meta, and then refreshes the local index. Use read_file first for existing notes and suggest_metadata first when you want classification hints.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative path from OBSIDIAN_ROOT | |
| content | Yes | Markdown body (without frontmatter delimiters) | |
| metadata | No | YAML frontmatter to write for the note. | |
| content_lock | No | If true, IGNORE content param and preserve original file text. Default false. |