evaluate_expression
Evaluate JavaScript expressions in a specific call frame or global context to inspect variables, test logic, and understand program state during debugging.
Instructions
Evaluates a JavaScript expression in the context of a specific call frame or global context. Use this to inspect variables, test expressions, or understand the program state. The expression is evaluated in the JavaScript runtime, so you can call methods, access properties, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ID of the debugging session. | |
| expression | Yes | JavaScript expression to evaluate. Examples: "myVariable", "array.length", "JSON.stringify(data)", "obj.method()" | |
| call_frame_id | No | Optional call frame ID to evaluate in. If not provided, evaluates in the global context. Obtain call_frame_id from get_call_stack. Evaluating in a frame provides access to local variables. | |
| return_by_value | No | Whether to return the result by value (serialised) or as a remote object reference. Defaults to true. Set to false for large objects to avoid serialisation overhead. |