edit-anchor-check
Check that an edit's old-string occurs exactly once in a file, with match contexts — Counts how many times an old-string occurs in a supplied file text (as a replace-in-file tool would see it) and returns each match's offset, line, column and surrounding lines, for an agent about to issue an edit. pass: exactly one literal match, even counting overlapping ones. unknown: several matches, or one match that overlaps another occurrence of the same text (ambiguous; contexts show how to
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>",
"oldString": "<oldString>"
},
"name": "edit-anchor-check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File text, at most 524288 UTF-8 bytes and 100000 lines. | |
| oldString | Yes | ||
| contextLines | No | Lines of context before and after each listed match. Default 2. |