Skip to main content
Glama

Evaluate GDScript

godot_eval

Execute GDScript code in a running Godot game and return the result as a string. Supports autoload singletons, method calls, and async operations.

Instructions

Run GDScript in the running game and return the result as a string. The code is compiled as a real script, so autoload singletons (e.g. GameState), method calls and await all work. A bare expression is auto-wrapped to return its value; multi-line code should return explicitly. The locals tree (SceneTree), root (Window) and scene (current scene) are provided. Examples: "GameState.last_health", "scene.get_node("Player").position", "return await some_node.some_async()".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_idNoHandle of a running game (e.g. "game-1"). Optional when exactly one game is running.
expressionYesGDScript to run: a bare expression, or statements ending in `return`.
response_formatNoOutput format. "markdown" is human-readable; "json" is structured.markdown
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations lack any hints, so the description must fully disclose behavior. It mentions code compilation, autoloads, await, and provided locals, but does not warn about potential side effects (e.g., modifying game state arbitrarily). This is a significant behavioral disclosure gap given the tool executes arbitrary code.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single well-structured paragraph, front-loaded with the main action, and includes specific examples inline. No unnecessary words—every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool lacks an output schema, so the description should fully cover output behavior. It states 'return the result as a string' but does not describe error handling (e.g., compile errors), which is critical for a code evaluation tool. The description is adequate but not comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters have schema descriptions (100% coverage), but the description adds value: it explains the expression parameter's auto-wrapping behavior, examples of usage, and clarifies the game_id optionality. This goes beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs GDScript in a running game and returns the result. It distinguishes itself from siblings by specifying the execution environment (compiled as a real script with autoloads, await support, and provided locals).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains how to use it: bare expressions are auto-wrapped, multi-line code needs explicit return, and it provides examples. It does not explicitly contrast with alternatives like game_eval, but the context of running in a real game with autoloads and await is clearly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Fulviuus/godot-mcp'

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