Skip to main content
Glama

run_script

Run custom GDScript in a live Godot project with full scene tree access. Scripts return JSON-serialized values.

Instructions

Execute a custom GDScript in the live running project with full scene tree access. Requires run_project first. Script must extend RefCounted and define func execute(scene_tree: SceneTree) -> Variant. Return values are JSON-serialized (primitives, Vector2/3, Color, Dictionary, Array, and Node path strings are supported). Use print() for debug output — it appears in get_debug_output, not in the script result. In spawned mode, runtime errors emitted to stderr are detected and either escalated (when the script returns null) or surfaced as warnings. In attached mode a null result includes a caveat since stderr is not captured.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesGDScript source code. Must contain "extends RefCounted" and "func execute(scene_tree: SceneTree) -> Variant".
timeoutNoTimeout in ms (default: 30000). Increase for long-running scripts.
Behavior5/5

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

With no annotations, the description fully discloses behavior: return value serialization, debug output channel, error handling differences between spawned/attached modes, and caveats. No gaps in behavioral disclosure.

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

Conciseness4/5

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

Description is detailed but efficient; each sentence adds necessary information. Could be slightly more concise, but no wasted words.

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

Completeness5/5

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

Comprehensive coverage of preconditions, script structure, return behavior, debug output, and error handling. No missing information for correct usage, especially given no output schema.

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?

Schema coverage is 100%, but description adds value by explaining script requirements beyond the schema and providing timeout advice. Baseline 3 is exceeded by adding context on default timeout and long-running script guidance.

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 action ('Execute a custom GDScript'), resource ('in the live running project'), and key capability ('with full scene tree access'), making it distinct from sibling tools like 'get_scene_tree' or 'run_project'.

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?

Explicitly notes prerequisite ('Requires run_project first') and provides script structure requirements ('extends RefCounted', function signature). Lacks explicit when-to-use vs alternatives but is sufficient for correct invocation.

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

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