obsidian_patch_file
Apply partial search-and-replace edits to a file, enabling small changes without sending the entire file content.
Instructions
Apply partial edits to a file using search and replace. More efficient than write_file for small changes as it doesn't require sending the entire file content.
IMPORTANT: Before calling this tool, you MUST first output a diff visualization in your response to show the user what changes will be made. Use this format:
- old line to be removed
+ new line to be addedThis helps the user understand the changes before they are applied.
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>",
"patches": "<patches>"
},
"name": "obsidian_patch_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file relative to vault root | |
| patches | Yes | Array of patch operations to apply in order |