Replace Text Across Notes
replace_textReplace text or regex matches across many Markdown notes with a dry-run preview and per-note diffs, then write the planned changes.
Instructions
Replace every match of one text or regular expression in the bodies of many notes; returns a preview with per-note diffs, or each note's outcome.
Use edit for one change in one note. Frontmatter is never matched. A call with dry_run true returns a plan; the same arguments with dry_run false and that plan write each note still as the dry run showed it.
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": {
"pattern": "<pattern>"
},
"name": "replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | The plan the dry run returned; needed when dry_run is false. | |
| paths | No | Notes to cover, by path. | |
| regex | No | Treat pattern as a regular expression. | |
| dry_run | No | True previews and writes nothing; false writes the plan. | |
| folders | No | Folders whose notes are all covered, recursively; `""` is the whole vault. Paths with a part starting with `.` are left out. | |
| pattern | Yes | Exact text to find, or a Python regular expression when regex is true. | |
| replacement | No | Text each match becomes; with regex, `\1` and `\g<name>` insert capture groups. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||