fix_inspection
MCP tools › Code insight and refactoring
Apply the quick fix of one finding of Ferris IDEA's own inspections (inspect_code names it), by file, 0-based line and column and inspection id; all fixes every finding of that inspection in the file, overlaps skipped. With several fixes at a place title picks one, else the first. Grammar findings also offer Ignore '<text>', Disable rule '<name>' and Apply all writing suggestions in file; a key missing in its resource bundle offers Add missing translation to <locales>. Dry run by default: returns title, count, edits and new text; dry_run=false writes, refusing if the file changed.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.fix_inspection |
|---|---|
| Area | Code insight and refactoring |
| Access | changes files |
| Reaches | process |
| Rights | write, trusted-project |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative file. |
line | integer | 0-based line of the finding, as inspect_code returns it (not needed with all).minimum 0 |
column | integer | 0-based column of the finding, as inspect_code returns it (not needed with all).minimum 0 |
idrequired | string | Inspection id, e.g. java.unused-import. |
all | boolean | Fix every finding of this inspection in the file (default false).default false |
title | string | The fix to apply when the place has several (its title as inspect_code names it, e.g.
Remove statement); default the first. |
dry_run | boolean | Only return the edits and the new text (default true). |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project fix_inspection '{"path":"<string>","id":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "path", "id" ], "properties": { "path": { "description": "Workspace-relative file.", "type": "string" }, "line": { "description": "0-based line of the finding, as `inspect_code` returns it (not needed with `all`).", "type": [ "integer", "null" ], "default": null, "minimum": 0 }, "column": { "description": "0-based column of the finding, as `inspect_code` returns it (not needed with `all`).", "type": [ "integer", "null" ], "default": null, "minimum": 0 }, "id": { "description": "Inspection id, e.g. `java.unused-import`.", "type": "string" }, "all": { "description": "Fix every finding of this inspection in the file (default false).", "type": "boolean", "default": false }, "title": { "description": "The fix to apply when the place has several (its title as `inspect_code` names it, e.g.\n`Remove statement`); default the first.", "type": [ "string", "null" ], "default": null }, "dry_run": { "description": "Only return the edits and the new text (default true).", "type": [ "boolean", "null" ] } }}