topos_refactor
Rank structural refactor hotspots for one file (read-only, advisory). Does not score the four pillars — use topos_evaluate_* for medals and topos_assess_* to verify edits afterward.
Instructions
Rank structural refactor hotspots for one file (read-only, advisory).
Does not score the four pillars — use topos_evaluate_* for
medals and topos_assess_* to verify edits afterward. target
selects the engine: cycles (CFG loop/branch bodies),
dependencies (MDG Forman curvature on imports; needs .gitnexus),
or process (execution choke points; needs .gitnexus). Returns a
RefactorResult with ranked hotspots (kind, label, score,
suggestion, optional lines).
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": {
"target": "<target>",
"filepath": "<filepath>"
},
"name": "topos_refactor"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum hotspots to return (default 5). | |
| target | Yes | Which analysis engine to run: `cycles` (CFG), or `dependencies` / `process` (need `.gitnexus`). | |
| filepath | Yes | Source file path relative to the MCP file root. | |
| gitnexus_dir | No | Override `.gitnexus` directory (`dependencies` / `process` targets). |