Skip to content

debug_set_variable

MCP tools › Debugger

Change a local variable (or, with reference, a field of a structured variable) in a stopped debug session and return the value as the debugger now shows it. Refused when the debug adapter cannot change values. Logged in .ferris-idea/agent-log.jsonl. Needs the debug right.

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

Capabilitydebug.debug_set_variable
AreaDebugger
Accesschanges ide, processes
Reaches—
Rightsdebug
Dry runnone

Arguments

ArgumentTypeDescription
sessionrequiredintegerSession id.minimum 0
namerequiredstringName of the variable (or of the field within reference).
valuerequiredstringNew value in the program's language, e.g. 42.
frameintegerFrame id whose local variable is changed (default the top frame of the thread that stopped last).
referenceintegerReference of a structured variable whose field name is changed instead of a local.

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_set_variable '{"session":1,"name":"<string>","value":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"session",
"name",
"value"
],
"properties": {
"session": {
"description": "Session id.",
"type": "integer",
"minimum": 0
},
"name": {
"description": "Name of the variable (or of the field within `reference`).",
"type": "string"
},
"value": {
"description": "New value in the program's language, e.g. `42`.",
"type": "string"
},
"frame": {
"description": "Frame id whose local variable is changed (default the top frame of the thread that stopped\nlast).",
"type": [
"integer",
"null"
]
},
"reference": {
"description": "Reference of a structured variable whose field `name` is changed instead of a local.",
"type": [
"integer",
"null"
]
}
}
}