vault_write
Write markdown content to a project vault section or create a new file with auto-generated frontmatter.
Instructions
Write to the vault: append, replace a section, or create a new file.
Modes:
append/replace: Update a project section. Requires section.
create: Create a new file with auto-generated frontmatter. Requires path; doc_type defaults to "note". Inferred automatically when you pass a path with no section, so operation may be omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Project slug or '_meta' for cross-project content. | |
| content | Yes | Markdown content to write (body only for create mode). | |
| operation | No | 'append', 'replace', or 'create'. Default 'append'. 'create' is inferred when path is set and section is empty. | append |
| section | No | Section shortcut (context, tasks, roadmap, lessons). For append/replace. | |
| path | No | Relative path for the file. Setting this with no section creates the file (create mode). | |
| doc_type | No | Document type for frontmatter (create mode). Optional; defaults to "note". | |
| commit | No | If True (default), auto-commit to git. If False, write to disk but leave the file dirty so the caller can batch many writes into one commit via the ``vault_commit`` tool, or let obsidian-git's auto-commit pick it up. Durability contract: files are persisted to disk regardless; only the *commit* is deferred. A crash before the next flush loses the commit, not the file content. | |
| idempotency_key | No | Optional at-most-once token. If set, a retry with the same key is a no-op (safe for transparent retries after a daemon restart cuts an in-flight write — ADR-013). Empty (default) disables idempotency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |