Skip to content

debug_start

MCP tools › Debugger

Start a debug session: native programs with lldb-dap, Go with Delve (go_test for tests), Python with debugpy, Node.js/TypeScript scripts or an npm_script with js-debug, or a Kotlin main_class. Breakpoints are set first, then it waits for the first stop or the end. Dry run (returns the launch request) unless dry_run false, which needs the user-granted debug right and returns a session id, the placed breakpoints (verified, moved line, reason if unbound; change with debug_breakpoints) and the state (stop reason, thread, frames, locals, or exit code). Logged in .ferris-idea/agent-log.jsonl. At most 4 sessions.

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

Capabilitydebug.debug_start
AreaDebugger
Accesschanges ide, processes
Reachesprocess, network
Rightsdebug, trusted-project
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
programrequiredstringWorkspace-relative program built with debug information.
argsarray of stringProgram arguments.
cwdstringWorkspace-relative working directory (default the root).
breakpointsarray of objectBreakpoints set before the program runs.
breakpoints[].pathrequiredstringWorkspace-relative source file.
breakpoints[].linerequiredinteger1-based line.minimum 0
breakpoints[].conditionstringStop only when this expression is true.
breakpoints[].hit_conditionstringStop only on this hit count (adapter syntax, e.g. 3 or >= 3).
breakpoints[].log_messagestringLog this message ({expr} interpolated) instead of stopping.
breakpoints[].enabledbooleanfalse keeps the breakpoint out of the session, like a switched-off one (default true).
stop_on_entrybooleanStop at the program entry (default false).
source_maparray of array of stringPath pairs [as built, as on disk] so breakpoints bind when the program was built through a symbolic link (see pending_breakpoints in the state).
wait_secondsintegerSeconds to wait for the first stop or the end (default 30, at most 300).minimum 0
main_classstringKotlin (SPEC-0132): the main class (e.g. demo.MainKt) of the Gradle or Maven project in the folder program, debugged with kotlin-debug-adapter; build the project first.
npm_scriptstringA script of the package.json in the folder program (SPEC-0168), run with the package's manager (npm run <script>) under js-debug; its Node.js child processes are debugged.
go_teststringGo (SPEC-0039 v7): debug the tests of the package program (its folder or one of its files) with Delve instead of running it. A test function's name (TestAdd) runs only that one, an empty text all tests of the package; args then go to the test binary.
exception_breakpointsstringStop on exceptions (SPEC-0146): caught (every thrown one), uncaught or both.
exception_typesstringOnly for these exception types, in the adapter's syntax (e.g. java.lang.NullPointerException).
function_breakpointsarray of stringStop on entry of these functions or methods (main, Shapes::area).
saved_breakpointsbooleanAlso set the workspace's saved breakpoints (saved_breakpoints), as the window's Debug action does: the line breakpoints with their properties, switched-off ones left out, and the saved exception, method and field breakpoints where the arguments above give none (default false).
dry_runbooleanOnly show the launch request (default true); false starts it and needs the debug right.

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 debug_start '{"program":"<string>"}'
Input schema as JSON
{
"properties": {
"program": {
"description": "Workspace-relative program built with debug information.",
"type": "string"
},
"args": {
"description": "Program arguments.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"cwd": {
"description": "Workspace-relative working directory (default the root).",
"type": [
"string",
"null"
]
},
"breakpoints": {
"description": "Breakpoints set before the program runs.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/DebugBreakpointArg"
}
},
"stop_on_entry": {
"description": "Stop at the program entry (default false).",
"type": [
"boolean",
"null"
]
},
"source_map": {
"description": "Path pairs [as built, as on disk] so breakpoints bind when the program was built through a\nsymbolic link (see `pending_breakpoints` in the state).",
"type": [
"array",
"null"
],
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"wait_seconds": {
"description": "Seconds to wait for the first stop or the end (default 30, at most 300).",
"type": [
"integer",
"null"
],
"minimum": 0
},
"main_class": {
"description": "Kotlin (SPEC-0132): the main class (e.g. `demo.MainKt`) of the Gradle or Maven project in the\nfolder `program`, debugged with kotlin-debug-adapter; build the project first.",
"type": [
"string",
"null"
]
},
"npm_script": {
"description": "A script of the `package.json` in the folder `program` (SPEC-0168), run with the package's\nmanager (`npm run <script>`) under js-debug; its Node.js child processes are debugged.",
"type": [
"string",
"null"
]
},
"go_test": {
"description": "Go (SPEC-0039 v7): debug the tests of the package `program` (its folder or one of its\nfiles) with Delve instead of running it. A test function's name (`TestAdd`) runs only that\none, an empty text all tests of the package; `args` then go to the test binary.",
"type": [
"string",
"null"
]
},
"exception_breakpoints": {
"description": "Stop on exceptions (SPEC-0146): `caught` (every thrown one), `uncaught` or `both`.",
"type": [
"string",
"null"
]
},
"exception_types": {
"description": "Only for these exception types, in the adapter's syntax (e.g. `java.lang.NullPointerException`).",
"type": [
"string",
"null"
]
},
"function_breakpoints": {
"description": "Stop on entry of these functions or methods (`main`, `Shapes::area`).",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"saved_breakpoints": {
"description": "Also set the workspace's saved breakpoints (`saved_breakpoints`), as the window's Debug\naction does: the line breakpoints with their properties, switched-off ones left out, and\nthe saved exception, method and field breakpoints where the arguments above give none\n(default false).",
"type": [
"boolean",
"null"
]
},
"dry_run": {
"description": "Only show the launch request (default true); false starts it and needs the `debug` right.",
"type": [
"boolean",
"null"
]
}
},
"$defs": {
"DebugBreakpointArg": {
"description": "A breakpoint for `debug_start`.",
"type": "object",
"properties": {
"path": {
"description": "Workspace-relative source file.",
"type": "string"
},
"line": {
"description": "1-based line.",
"type": "integer",
"minimum": 0
},
"condition": {
"description": "Stop only when this expression is true.",
"type": [
"string",
"null"
]
},
"hit_condition": {
"description": "Stop only on this hit count (adapter syntax, e.g. `3` or `>= 3`).",
"type": [
"string",
"null"
]
},
"log_message": {
"description": "Log this message (`{expr}` interpolated) instead of stopping.",
"type": [
"string",
"null"
]
},
"enabled": {
"description": "false keeps the breakpoint out of the session, like a switched-off one (default true).",
"type": [
"boolean",
"null"
]
}
},
"required": [
"path",
"line"
]
}
},
"required": [
"program"
],
"type": "object"
}