lines.replace
Replace a specific line range in an Obsidian file, using a hash to ensure the range hasn't changed, preventing edit conflicts.
Instructions
Replace a contiguous line range (1-based, inclusive). Requires expected_range_hash returned by file.read_range or outline (section_hash).
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": {
"file": "<file>",
"from": "<from>",
"to": "<to>",
"content": "<content>",
"expected_range_hash": "<expected_range_hash>"
},
"name": "lines.replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| file | Yes | ||
| from | Yes | ||
| vault | No | ||
| content | Yes | ||
| dry_run | No | ||
| expected_range_hash | Yes |