batch_refactor
Apply a refactor instruction to every file matching a glob pattern. Review diffs with dry run before writing changes.
Instructions
Apply a refactor instruction to every file matching a glob pattern, sequentially.
glob_pattern matches relative paths under root_dir (default: the
server's allowed base directory), e.g. "src/**/*.py". Files are
processed one at a time against the local model. With dry_run=True
(the default) nothing is written -- you get a unified diff per file to
review first; set dry_run=False to write accepted changes to disk.
Large match sets are capped (see OLLAMA_MCP_MAX_BATCH_FILES) to avoid
runaway sequential runs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| think | No | ||
| dry_run | No | ||
| root_dir | No | ||
| instruction | Yes | ||
| glob_pattern | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |