Skip to content

build_task

MCP tools › Run, test and tasks

A task of the build tools window: its run configuration, debug variant (attach with debug_attach once the agent listens), triggers and keymap action id for set_shortcut. before_sync, after_sync, before_build, after_build, before_run switch its triggers (write right). Without task: the triggers and the Build Project chain. With file: recompile, the build of the innermost Maven, Gradle, Cargo or Go module holding it (null if none), without running it.

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

Capabilityexecution.build_task
AreaRun, test and tasks
Accesschanges files
Reaches—
Rightswrite
Dry runnone

Arguments

ArgumentTypeDescription
modulestringModule folder as in project_model (. for the root).
filestringA workspace-relative file: return the step Recompile runs for it instead (SPEC-0100 v5).
taskstringThe task's label as the build tools window lists it (test, compiler:compile); without it the triggers and the Build Project chain are returned.
before_syncbooleanRun the task before a sync of the build files; the sync reads them when it succeeded (needs the write right; SPEC-0100 v4).
after_syncbooleanRun the task after a sync has read the build files (needs the write right).
before_buildbooleanRun the task before Build Project's build steps (needs the write right).
after_buildbooleanRun the task after a successful Build Project (needs the write right).
before_runbooleanRun the task before every run configuration started from the run widget (needs the write right).
debug_portintegerThe port the debug variant's JDWP agent listens on (default 5005).minimum 0 · maximum 65535

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 build_task
Input schema as JSON
{
"type": "object",
"properties": {
"module": {
"description": "Module folder as in `project_model` (`.` for the root).",
"type": [
"string",
"null"
],
"default": null
},
"file": {
"description": "A workspace-relative file: return the step Recompile runs for it instead (SPEC-0100 v5).",
"type": [
"string",
"null"
],
"default": null
},
"task": {
"description": "The task's label as the build tools window lists it (`test`, `compiler:compile`); without\nit the triggers and the Build Project chain are returned.",
"type": [
"string",
"null"
],
"default": null
},
"before_sync": {
"description": "Run the task before a sync of the build files; the sync reads them when it succeeded\n(needs the `write` right; SPEC-0100 v4).",
"type": [
"boolean",
"null"
],
"default": null
},
"after_sync": {
"description": "Run the task after a sync has read the build files (needs the `write` right).",
"type": [
"boolean",
"null"
],
"default": null
},
"before_build": {
"description": "Run the task before Build Project's build steps (needs the `write` right).",
"type": [
"boolean",
"null"
],
"default": null
},
"after_build": {
"description": "Run the task after a successful Build Project (needs the `write` right).",
"type": [
"boolean",
"null"
],
"default": null
},
"before_run": {
"description": "Run the task before every run configuration started from the run widget (needs the\n`write` right).",
"type": [
"boolean",
"null"
],
"default": null
},
"debug_port": {
"description": "The port the debug variant's JDWP agent listens on (default 5005).",
"type": [
"integer",
"null"
],
"default": null,
"minimum": 0,
"maximum": 65535
}
}
}