Skip to main content
Glama

Script / Execute

script-execute
Destructive

Compiles and runs C# snippets or classes inside the Godot editor, returning the result and printed output; endless loops and runaway recursion are stopped by a time budget.

Instructions

Prefer rql-mutate for scene, resource and project edits: one line instead of C# to compile. 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)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "csharpCode": "<csharpCode>"
    },
    "name": "script-execute"
  }
}

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.4/5.0
Behavior5/5

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

Annotations already declare destructive/openWorld/non-idempotent, and the description still adds substantial execution semantics: the 30 s default time budget with loop and recursion guarding, the fact that the process survives, and a precise account of which spawned work is killed (threads/tasks at next loop iteration or call) versus which is NOT (timers, async void after first await, blocked waits). It also discloses the return payload (result plus printed output, with the Console vs. GD.Print 4.5+ caveat).

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

Conciseness3/5

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

The alternative and the core behavior are correctly front-loaded, but the second half is a dense run-on covering guards, thread semantics, and an argument-type primer in one paragraph. Some content restates the schema's own field docs (className, methodName, isMethodBody), and the final sentence trails off mid-thought, which hurts scannability for a tool this consequential.

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

Completeness4/5

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

For arbitrary code execution with 8 parameters and no output schema, the definition covers the essentials: sandbox limits, timeout ceiling behavior via the schema, spawn-lifecycle tells, and the return shape. It stops short of stating what a compile failure surfaces as (error vs. exception) or whether prior runs' state persists, which are the remaining gaps for a tool of this risk profile.

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 schema baseline is 3, but the description earns a bump by explaining the RQL value syntax for arguments — {key: value}, [a, b], ref("Node3D#12") taken from a query result, godot.find("Name") — which the schema only names as 'SerializedMemberList'. That is genuine meaning beyond the schema, though the trailing sentence is truncated and never closes its parenthesis.

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?

States a specific verb and resource — 'Compiles and runs C# in the Godot editor' — and immediately disambiguates its two modes (snippet vs. declared class with static method). The opening line also names the sibling it is not (rql-mutate), so an agent can route without opening either schema.

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?

'Prefer rql-mutate for scene, resource and project edits: one line instead of C# to compile' gives an explicit alternative plus the condition that selects it, which is exactly the kind of routing guidance that matters. It stops short of a full when/when-not statement (e.g. no guidance versus script-validate or script-build for checking/building code), so it is clear context rather than complete exclusions.

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