# `eval` Run a snippet of GDScript in the editor and return its result. **Input** — `code` (required) The snippet becomes the body of a function, so it is statements ending in `return ` — no `extends`, `class_name` or top-level `func`. Whatever `return` produces is what comes back; a `print` goes to the editor's Output panel, not to the result. Dictionaries and arrays come back as JSON, other values as text. It runs on the editor's main thread with the same access the editor has, which is what makes it useful for checking an engine API, a node, a resource or a computed value without leaving the chat. ## Caution There is no sandbox and no timeout. A running GDScript function cannot be interrupted, so a loop that never ends hangs the editor — Stop cannot help, because the turn is not waiting on a request. Keep snippets short and terminating, and use the file and settings tools for changes you mean to keep; `eval` is for looking and testing. A compile error is reported without the offending line: Godot names it in the Output panel and the editor log, so `read_log` with `which=editor` shows it.