Edit DAT content (surgical)
edit_dat_contentReplace a specific substring in a Text or Table DAT's text. Requires exactly one match by default, or set replace_all to change every occurrence.
Instructions
Surgically replace a substring inside a Text or Table DAT's .text. Without replace_all, requires exactly one match — 0 or >1 occurrences is an error, forcing the caller to add context or set replace_all. Use set_dat_content to overwrite an entire DAT's text in place; use this to make a targeted edit.
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": {
"dat_path": "<dat_path>",
"old_string": "<old_string>",
"new_string": "<new_string>"
},
"name": "edit_dat_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dat_path | Yes | Absolute path to the Text or Table DAT to edit (e.g. '/project1/mytext1'). | |
| new_string | Yes | Replacement text. May be empty to delete the matched substring. | |
| old_string | Yes | Exact substring to find. Must match at least once. Empty strings are rejected. | |
| replace_all | No | When false (default), requires exactly one match — 0 or >1 occurrences is an error. Set true to replace every occurrence. |