Edit Note
editReplace precise text or line ranges in Markdown notes using exact, scoped, or normalized matching. Retrieve the latest content first to ensure accurate changes.
Instructions
Make a targeted text replacement in an existing .md note (not supported for attachments).
Three edit modes:
Exact match (old_text only): pass a portion of the file as old_text — must appear exactly once. Frontmatter can be edited.
Line-range (line_start + line_end, no old_text): replace the specified lines with new_text. Lines are 1-based (matching 'read' output). Recommended: pass if_match for safety.
Scoped match (old_text + line_start/line_end): search for old_text within the line range only — useful when old_text appears multiple times in the file.
When exact match fails, a normalized comparison is attempted (Unicode NFC, dash/quote normalization, whitespace collapsing). If a unique normalized match is found, it is used and match_type='normalized' is returned.
Always call 'read' first to get the current text and line numbers. The search index is updated immediately; do not call 'reindex'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Relative path to the document. | |
| if_match | No | Optional etag obtained from a previous 'read' call. When provided, the edit only proceeds if the file has not been modified since that read (optimistic concurrency). | |
| line_end | No | Last line to replace (1-based, inclusive). Must be provided together with line_start. | |
| new_text | No | Replacement text. May be longer or shorter. | |
| old_text | No | Text to replace. Must appear exactly once in the document or line range. Get this via 'read'. Optional when using line-range mode. | |
| line_start | No | First line to replace (1-based, inclusive). Must be provided together with line_end. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||