Skip to main content
Glama

Script / Execute

script-execute
Destructive

Compile and run C# code or a class method directly in the Godot editor, returning the result and printed output. Timeouts stop endless loops while the process keeps running.

Instructions

Compiles and runs C# in the Godot editor: plain statements with the last expression as the result (own usings, local classes, await allowed), or a declared class 'className' with static method 'methodName'. Returns the result and the printed output (Console; GD.Print on Godot 4.5+). Guarded: an endless loop is stopped when its time budget ('timeout', default 30 s) runs out, and runaway recursion is stopped, with an error, and the process keeps running. Threads and tasks the code starts (new Thread, Task.Run, ThreadPool) are stopped at their next loop iteration or call once the run ends (a warning counts them); timers, async void code after its first await and work blocked in a wait are not, so join or await what you start.

Argument types — give these arguments as RQL values (as in rql-mutate): {key: value, …}, [a, b], "text", 1.5, true, ref("Node3D#12") from a query result, godot.find("Name"); leave out keys you do not need: SerializedMemberList — named values {count: 3, label: "x", target: ref("Node3D#12")}: each is passed as a parameter of the value's type (a node, string, int, float, bool)

Input Schema

NameRequiredDescriptionDefault
usingsNoExtra namespaces for snippet mode, e.g. ["MyGame.Gameplay"].
includeNoHelper .cs files or folders (recursive) compiled with the code, relative to <project>/.ai-game-dev/snippets.
timeoutNoTime budget of the run in seconds (default 30, at most 240; 0 = default). When it runs out the code is stopped at its next loop iteration or call and the call fails with Timeout; give long-running work a larger value.
classNameNoFull mode: the class whose static method runs (namespace-qualified or not).
csharpCodeYesC# code. Snippet: 'var root = EditorInterface.Singleton.GetEditedSceneRoot();\nroot.GetChildCount()' (System, LINQ and Godot are imported; the last expression is the result, so no ';' after it). Full: 'using Godot;\npublic class Script { public static int Main() { return 42; } }' (full code brings its own usings).
methodNameNoFull mode: the static method to run.
parametersNoValues for the snippet's / method's parameters by name, e.g. {node: ref("Node3D#12"), n: 6}. Leave empty if there are none. RQL: SerializedMemberList
isMethodBodyNoForce snippet mode even when the code declares 'className'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.35.1

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only say destructive/open-world/non-idempotent; the description goes far beyond by disclosing exactly what is guarded (endless loops against a time budget, runaway recursion), that the process survives failures, and precisely which spawned concurrency (Thread, Task.Run, ThreadPool) is cleaned up versus which is not (timers, async void after first await, blocked waits). It also states the failure mode ('fails with Timeout') and that leftover threads produce a warning, which is unusually honest behavioral disclosure for an execution tool.

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?

It is front-loaded with the core purpose and modes, and nearly every sentence carries operational information (timeouts, thread cleanup, RQL encoding). The second paragraph is a dense wall of text with an unfinished sentence ('(a node, string, int, float, bool)'), and the timeout default is restated from the schema, so it is not fully tight.

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?

For an 8-parameter, no-output-schema execution tool this covers the essentials: what is returned (result plus Console/GD.Print output), both compilation modes, parameter passing syntax, resource limits, and concurrency cleanup caveats. An agent has enough to invoke it correctly and to anticipate failure modes without further documentation.

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%, so the baseline is 3, but the description adds meaning the schema does not: the RQL value grammar ({key: value}, [a, b], "text", ref("Node3D#12"), godot.find("Name")) and the rule that each named value is passed as a parameter of that value's type. That materially helps an agent construct 'parameters' correctly. Minor deduction because the argument-types explanation trails off with an incomplete parenthetical and repeats the timeout default already in the schema.

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

Purpose4/5

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

The first clause gives a precise verb and resource: 'Compiles and runs C# in the Godot editor', then distinguishes its two operating modes (snippet with implicit usings vs. a declared class with a static method). It is immediately clear what the tool does and how it differs in effect from a build/validate tool, though no sibling (script-build, script-validate, rql-query) is named explicitly to route the agent.

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?

It gives real in-tool selection guidance: snippet vs. full class, when to set className/methodName, how isMethodBody overrides mode detection, and 'leave out keys you do not need' for parameters. It also explains when to raise 'timeout'. What it lacks is any statement of when to choose this over siblings like script-build or rql-query, so it stops short of explicit alternatives.

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