edit_preview
Preview where specific text matches in a file to verify anchor uniqueness before making edits. Returns match count, line numbers, and snippets without modifying the file.
Instructions
Show where old_string would match in a file, without editing it.
Returns the match count, 1-based line numbers, and short snippets so you
can confirm an anchor is unique before calling edit. Read-only and cheap
(kept under ~200 tokens), so use it freely as a probe. Raises an error on
a binary file or an empty old_string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path to search (absolute, or relative to root). | |
| old_string | Yes | Anchor text to locate. Must match exactly, including whitespace and indentation. Cannot be empty. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| found | No | ||
| context | No | ||
| truncated | No | ||
| match_count | No | ||
| line_numbers | No |