vault_patch
Patch Obsidian vault notes by updating headings, blocks, or frontmatter properties only when a supplied version guard matches, preventing overwrites when content has changed.
Instructions
Patch a heading/block/property with ifMatch or ifMatchGuard (copy versionGuard) from a read/map. Copy map keys unchanged. Heading content without within: # is one level below the target for content (default), or the target's actual parent for markerAndContent prepend/append. No automatic retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| scope | No | ||
| value | No | ||
| target | Yes | ||
| within | No | ||
| content | No | ||
| ifMatch | No | ||
| operation | Yes | ||
| targetType | Yes | ||
| destination | No | Heading move only: operation=replace, scope=parent; omit content. | |
| ifMatchGuard | No | ||
| createTargetIfMissing | No | ||
| allowSubtreeReplacement | No | Explicitly allow heading content/whole-section replace to remove child sections; the version precondition still applies. | |
| rejectIfContentPreexists | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| created | Yes | ||
| message | Yes | ||
| version | Yes | ||
| warnings | No | ||
| sizeBytes | Yes | ||
| versionGuard | Yes | ||
| beforeSizeBytes | Yes |