update_note
Modify existing notes in Obsidian by applying text replacements or inserting content at specific headings or positions—ideal for precise edits.
Instructions
Update content in an existing note using text replacements or precise insertions
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dryRun | No | Preview changes without applying them | |
edits | Yes | Array of edit operations to apply | |
path | Yes | Path to the note within the vault |
Input Schema (JSON Schema)
{
"properties": {
"dryRun": {
"default": false,
"description": "Preview changes without applying them",
"type": "boolean"
},
"edits": {
"description": "Array of edit operations to apply",
"items": {
"anyOf": [
{
"required": [
"oldText",
"newText"
]
},
{
"required": [
"mode",
"heading",
"content"
]
},
{
"required": [
"mode",
"blockId",
"content"
]
}
],
"properties": {
"blockId": {
"description": "Block ID for block-based insertion (^block-id)",
"type": "string"
},
"content": {
"description": "Content to insert (for insert mode)",
"type": "string"
},
"heading": {
"description": "Target heading for insert mode",
"type": "string"
},
"level": {
"description": "Heading level (1-6) for more precise targeting",
"maximum": 6,
"minimum": 1,
"type": "number"
},
"mode": {
"default": "replace",
"description": "Edit mode: replace (default) or insert",
"enum": [
"replace",
"insert"
],
"type": "string"
},
"newText": {
"description": "Text to replace with (for replace mode)",
"type": "string"
},
"oldText": {
"description": "Text to search for and replace (for replace mode)",
"type": "string"
},
"position": {
"default": "after",
"description": "Where to insert relative to heading: before (above heading), after (below heading), append (end of section), prepend (start of section)",
"enum": [
"before",
"after",
"append",
"prepend"
],
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"path": {
"description": "Path to the note within the vault",
"type": "string"
}
},
"required": [
"path",
"edits"
],
"type": "object"
}