edit_note
Modify an existing Obsidian note by replacing content, appending, or using find-and-replace. Supports section-specific edits and dry-run previews.
Instructions
Edit an existing note in the Obsidian vault. Requires a readwrite API key.
See get_vault_guide for Obsidian syntax and any vault-specific conventions
(naming, folder placement, frontmatter, tags).
Four mutually exclusive modes (set at most one of append/find/section):
Full replace (default): provide only
content; the entire file is overwritten.Append:
append=True;contentis added at the end (preceded by a single newline).Find & replace:
find=<exact text>; replaced withcontent. Must match exactly once unlessreplace_all=True.Section:
section=<heading>; replaces the body under the named ATX heading. Use the path-style formParent/Childto disambiguate when the same heading appears more than once. Setext (====/----) headings are not matched.
Flags:
replace_all=True: withfind, replace every occurrence rather than failing on multiple matches. Ignored whenfindis unset.dry_run=True: compute the would-be result and return a unified diff without writing. Works for all four modes.
Writes are atomic (tmp file + os.replace) so a crash mid-write cannot truncate
the destination. Frontmatter mutation is better done via set_frontmatter —
PyYAML serialization there discards YAML comments.
Args:
path: Vault-relative path to the note.
content: New full content, replacement text, text to append, or section body.
append: If True, append content to the end of the note.
find: Exact text to find and replace.
section: ATX heading text identifying the section whose body to replace.
Use Parent/Child to disambiguate repeated headings.
replace_all: With find, replace every match instead of requiring uniqueness.
dry_run: Return a unified diff and do not write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| append | No | ||
| find | No | ||
| section | No | ||
| replace_all | No | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |