patch_vault
Correct or extend an existing vault item by updating frontmatter fields such as tags, status, and relations without rewriting the whole file; updated_at is bumped automatically.
Instructions
Patch frontmatter fields on an existing vault item. updated_at is always bumped.
Use this to correct or extend an existing item — e.g. add/remove relations, update tags, change status — without rewriting the whole file.
Workflow:
Call read_vault(path) to get the current content.
Parse the fields you want to change and construct their new values in full (e.g. the complete new relations list, not just the items to add).
Call patch_vault(path, updates={...}) with only the fields that changed.
Args: path: 8-character hex UID (e.g. "0b74b77c"), absolute path, or path relative to vault_root (e.g. "notes/my-note.md"). Prefer the UID when you have it — no lookup call is needed. updates: Dict of frontmatter fields to overwrite. Pass complete new values. Common uses: relations: [{uid: "a1b2c3d4", type: "belongs-to"}, ...] tags: ["tag-a", "tag-b"] status: "done" summary: "Updated summary." Do NOT put the body here — 'body' is not a frontmatter field. A 'body' key in updates is rerouted to the body argument and a warning is returned; a null value there clears the body. Any stale 'body' key already in the file's frontmatter is stripped on every patch. body: If provided, replaces the full body text. Always pass new body text here, never inside updates. Pass "" to clear it.
Returns {uid, path, type, title, ...}, plus tag_warnings when a tag names a project/entity/topic (belongs as a relation) or repeats the node's own type or subtype. The patch has already happened; surface the warning and offer the fix. Other warnings, all of which also arrive after the write: relation_warnings (unknown relation type), has_asset_warnings (unknown scheme or a missing scheme field in has_asset), and field_warnings (a field the patch touched now breaks its type's required fields or enum; a change to type or subtype checks the whole node).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| path | Yes | ||
| updates | Yes |