evaluate_expression
Execute arbitrary GDScript expressions at runtime and receive the result, enabling real-time debugging and state inspection.
Instructions
Execute an arbitrary GDScript expression at runtime and return the result. The expression runs in the context of the current scene (e.g., "get_tree().current_scene.name", "Vector2(1,2).length()"). Useful for debugging, querying state, and one-off calculations. The project must be running via run_interactive.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | The GDScript expression to evaluate (e.g., "get_tree().current_scene.name", "$Player.position", "2 + 2"). |