Edit
editModify markdown vault notes safely. Supports AST-based changes, line/string replacements, frontmatter updates, and batch operations with dry run preview.
Instructions
Edit notes safely. Vault scope: general markdown notes vault. Supports AST edits by heading/block ID, freeform line/string replacement, frontmatter_set metadata merges, batch operations (max 50), and dryRun=true unified diff previews. Read vault://overview for editing strategy and conventions.
TIPS: Always use dryRun=true before destructive operations (delete, replace). Use bulk_read for reading 2+ files. Use view.outline before heading-specific edits when unsure of heading names. string_replace requires exact literal match including whitespace/newlines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Note path (required for single edit). | |
| dryRun | No | If true, returns a preview of changes as a unified diff without saving to disk. | |
| blockId | No | ||
| content | No | Content to apply (required for single edit, ignored for delete). | |
| endLine | No | ||
| heading | No | ||
| operation | No | Edit operation (required for single edit). 'delete' removes the full heading section including child headings. 'replace' by default replaces only the body under the heading (heading node preserved). Use replaceMode='section' to replace the heading and all its content. | |
| startLine | No | ||
| operations | No | For batch mode: array of edit operations (max 50). Executed sequentially, stops on first error. | |
| replaceAll | No | ||
| searchText | No | ||
| replaceMode | No | For replace operation: 'body' (default) preserves the heading node and replaces only body content. 'section' replaces the entire heading section including the heading node and all child headings. | |
| headingDepth | No | ||
| returnContent | No | When set to 'section' or 'file', the response includes the modified content (max 8KB). Defaults to 'none'. |