refactor-mcp provides 2 tools with well-defined schemas and reasonable descriptions, but lacks critical safety patterns for destructive operations. Both tools have complete input schemas with type definitions and parameter descriptions. Tool descriptions exist but are brief (56-62 chars). The server is missing error recovery guidance, confirmation patterns for the destructive write tool, and detailed output schema documentation. Parameter descriptions are adequate but could be more prescriptive about constraints. The code_refactor tool performs unguarded file modifications without dry-run confirmation, which is a production concern.
Refactor code by replacing search pattern with replace pattern using regex
Search for code patterns using regex and return file locations with line numbers
Destructive tool lacks confirmation/dry-run requirement. code_refactor modifies files without mandatory confirmation or explicit dry-run default. Agents can trigger destructive changes without safeguards, causing data loss.
No error recovery guidance. Neither tool description explains what to do if patterns fail to match, file access is denied, or regex is invalid. LLMs cannot self-correct without actionable error messages.
Output schema not documented. Tools return RefactorResult[] and match details but the description does not specify the fields, types, or structure of results. LLMs cannot plan downstream calls without knowing what fields are present.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 52 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 43 | - | v1 |
Tool descriptions are too brief (55-62 chars). Both descriptions lack context on WHEN to use the tool vs similar patterns, prerequisites (e.g., valid regex syntax), or how results are structured. Descriptions should be 50-200 chars with full actionability.
Parameter constraints not fully prescriptive. searchPattern and replacePattern accept any string but should document they must be valid regex. filePattern should document glob syntax. Undocumented constraints let LLMs pass invalid input.
No explicit dry-run safety pattern. code_refactor has a dryRun internal flag but the tool definition does not expose it as a parameter. Agents cannot preview changes before applying them.