Skip to main content
Glama

evaluate_expression

Evaluate JavaScript expressions during debugging to inspect variables, test code snippets, or analyze program state within specific call frames or global context.

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

TableJSON Schema
NameRequiredDescriptionDefault
session_idYesID of the debugging session.
expressionYesJavaScript expression to evaluate. Examples: "myVariable", "array.length", "JSON.stringify(data)", "obj.method()"
call_frame_idNoOptional 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_valueNoWhether 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.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/johngrimes/mcp-js-debugger'

If you have feedback or need assistance with the MCP directory API, please join our Discord server