Search and replace strings in files across directories with support for case-insensitive search, whole-word matching, recursive scanning, and exclude filters.
The 'repfor' tool has a well-structured input schema with 11 parameters, each with type definitions and descriptions. The tool description is comprehensive (181 characters) and explains the primary function clearly. However, there are several quality gaps: (1) the tool name 'repfor' does not start with an action verb, it should be 'replace_in_files' or 'search_replace' to immediately signal intent to LLMs; (2) parameter descriptions lack actionable constraints and examples for format guidance; (3) no output schema is documented, callers don't know what fields to expect from the Result struct; (4) error handling is minimal, no guidance on recovery strategies or error categorization; (5) the tool performs a destructive write operation (modifies files) but lacks a mandatory dry_run default or confirmation pattern to prevent accidental data loss.
Search and replace strings in files across directories. By default scans single-depth (non-recursive), but supports recursive scanning with the 'recursive' option. In-place file modifications with extension filtering, case-insensitive search, whole-word matching, and exclude filters.
Tool name does not start with action verb. 'repfor' is cryptic and does not convey action. Should be 'replace_in_files', 'search_replace', or 'search_and_replace_files'.
Output schema not documented. Tool returns a Result struct with nested DirectoryResult and FileModification objects, but the LLM context receives no description of these fields or their types. LLMs cannot plan downstream operations without knowing the response format.
Parameter descriptions lack actionable format constraints. E.g., 'search' says 'String to search for' but does not mention regex support, escape sequences, or character limits. 'ext' lacks examples of valid extensions (.go, .ts, etc.). LLMs cannot reason about valid input without explicit constraints.
Destructive operation lacks confirmation pattern. The tool modifies files in-place and has no mandatory confirmation step or required explicit acknowledgment. While dry_run is available, it is optional and defaults to false, creating risk of accidental bulk file deletion or corruption.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 48 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 38 | - | v1 |
No error guidance or recovery hints. If a file is not found, not readable, or a replacement fails on some files, the error response does not guide the LLM on retry strategy or alternative actions. Error handling is silent and non-actionable.
Parameter 'ext' documentation uses example notation instead of enum. Description says 'e.g. .go, .txt' rather than defining a formal enum or pattern constraint. LLMs may pass invalid extension formats like 'go' (missing dot) or hallucinate unsupported extensions.
Parameters 'file' and 'dir' accept both array and single string, creating type ambiguity. Description says 'Can also accept a single string' but schema declares type 'array'. LLMs may be confused about whether to pass a string or wrapped array, leading to validation failures.
No dependency hints or sequencing guidance. If search_terms are complex or directory structure is unknown, no hint guides the LLM on how to discover target files, validate patterns before bulk operations, or understand the cascading impact of recursive flag.