Skip to content

apply_context_action

MCP tools › Code insight and refactoring

Apply a row of context_actions by title, or an option of its submenu. Dry run by default: returns the configuration a run row starts, or for a fix a per-file preview of changed lines. dry_run=false: Run '…' and Profile '…' run once (need run and a trusted project); Debug '…' is refused, use debug_start; own fixes, Fix all… and language-server actions write the file (write). Disable '<title>'/Enable '<title>' change the user's disabled intentions (settings); Edit intention settings returns that list.

Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.

Capabilitycode.apply_context_action
AreaCode insight and refactoring
Accesschanges files, processes, settings
Reachesprocess
Rightswrite, run, settings, trusted-project
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative file path.
linerequiredinteger0-based line of the caret.minimum 0
characterrequiredinteger0-based character of the caret (Unicode scalar values).minimum 0
titlestringTitle of the row (apply_context_action only).
optionstringLabel of an option of the row's submenu, e.g. Disable '<title>', Enable '<title>' (for a hidden intention) or Fix all '<name>' problems in file (apply_context_action only).
dry_runbooleanOnly report what would happen (default true; apply_context_action only).

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.

Terminal window
ferris-idea call ~/my-project apply_context_action '{"path":"<string>","line":1,"character":1}'
Input schema as JSON
{
"type": "object",
"required": [
"path",
"line",
"character"
],
"properties": {
"path": {
"description": "Workspace-relative file path.",
"type": "string"
},
"line": {
"description": "0-based line of the caret.",
"type": "integer",
"minimum": 0
},
"character": {
"description": "0-based character of the caret (Unicode scalar values).",
"type": "integer",
"minimum": 0
},
"title": {
"description": "Title of the row (`apply_context_action` only).",
"type": [
"string",
"null"
]
},
"option": {
"description": "Label of an option of the row's submenu, e.g. `Disable '<title>'`, `Enable '<title>'` (for\na hidden intention) or `Fix all '<name>' problems in file` (`apply_context_action` only).",
"type": [
"string",
"null"
]
},
"dry_run": {
"description": "Only report what would happen (default true; `apply_context_action` only).",
"type": [
"boolean",
"null"
]
}
}
}