Edit note text
patch_noteEdit a note in the Obsidian vault by replacing exact text. Obsidian Sync only syncs .md, .canvas and .base files here, so other extensions such as .txt fail. Read the note with read_note to get the exact text. To make several changes to one note, pass them all in edits in one call. Returns once Obsidian Sync has the edit, or after about 35s with status upload_pending. A repeat edit within 10 to 30s of the note's last upload returns at once with status waiting_for_upload; it still uploads.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "patch_note"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | vault-relative note path, as returned by list_files or search_notes, or an obsidian:// URL for a file in this vault | |
| edits | No | several edits to this note, applied in order, each to the result of the previous one; if one fails, nothing is written. Use instead of old_text, new_text and replace_all | |
| new_text | No | replacement text; empty deletes old_text | |
| old_text | No | exact text to replace; must match exactly once unless replace_all is set. Leave empty when using edits | |
| replace_all | No | replace every occurrence of old_text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | vault-relative path of the note | |
| status | Yes | uploaded: Obsidian Sync has the edit. waiting_for_upload: the edit is saved, and Obsidian Sync uploads it within 30s, because it holds back a note's next upload for 10 to 30s after the last one. upload_pending: the edit is saved, but its upload wasn't confirmed within 35s, or an earlier edit of the note is still queued, for example because the server is reconnecting to Obsidian Sync; it uploads once the connection is back | |
| uploaded | Yes | whether Obsidian Sync has the edit; if false the edit is saved and still queued for upload, as status explains | |
| replacements | Yes | number of occurrences replaced, over all edits |