obsidian_patch_file
Modify Obsidian notes by inserting content relative to headings, block references, or frontmatter fields using append, prepend, or replace operations.
Instructions
Insert content into an existing note relative to a heading, block reference, or frontmatter field.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | Yes | Content to insert | |
filepath | Yes | Path to the file (relative to vault root) | |
operation | Yes | Operation to perform (append, prepend, or replace) | |
target | Yes | Target identifier (heading path, block reference, or frontmatter field) | |
target_type | Yes | Type of target to patch |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"description": "Content to insert",
"type": "string"
},
"filepath": {
"description": "Path to the file (relative to vault root)",
"format": "path",
"type": "string"
},
"operation": {
"description": "Operation to perform (append, prepend, or replace)",
"enum": [
"append",
"prepend",
"replace"
],
"type": "string"
},
"target": {
"description": "Target identifier (heading path, block reference, or frontmatter field)",
"type": "string"
},
"target_type": {
"description": "Type of target to patch",
"enum": [
"heading",
"block",
"frontmatter"
],
"type": "string"
}
},
"required": [
"filepath",
"operation",
"target_type",
"target",
"content"
],
"type": "object"
}