evaluate_expression
Evaluate expressions in a debug session to read or modify program state. Uses the current frame unless a frame ID is provided.
Instructions
Evaluate expression in the current debug context. Without frameId, uses the same adopted top frame as stack and locals — at a breakpoint or step that is the frame the program stopped in even when the stack display would hide it — and discloses an automatic thread switch or a hidden paused frame in anchorNote; frame names the frame that was used, on success and on failure. Expressions can read and modify program state. Waits up to 30s by default
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sessionId": "<sessionId>",
"expression": "<expression>"
},
"name": "evaluate_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frameId | No | Optional authoritative stack frame ID from get_stack_trace. When provided, no automatic frame/thread selection occurs | |
| timeout | No | Max time (ms) to wait for the evaluation to complete (default: 30000, max: 600000). On expiry the request fails but the expression may keep executing in the debuggee. Note: your MCP client may enforce its own overall request timeout | |
| sessionId | Yes | ||
| expression | Yes |