Skip to main content
Glama

execute_script

Run multi-line GDScript code in the current scene's context at runtime, with support for variables, loops, and control flow for complex logic.

Instructions

Execute a multi-line GDScript block at runtime in the current scene context. Unlike evaluate_expression, supports variables, loops, and control flow. Requires run_interactive.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe GDScript code to execute. Runs as a function body in the context of the current scene. Use "return x" to return a value. Example: "var p = $Player\nreturn p.position"
Behavior3/5

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

Annotations are all false, so the description must convey behavioral traits. It notes the tool executes code in the current scene context and requires run_interactive, but it does not disclose potential side effects, state changes, or failure modes beyond the absence of read-only guarantees. This is adequate but not rich.

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 two sentences with no filler. It front-loads the primary action, adds a clear differentiator, and states a necessary prerequisite, making every word useful.

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 description covers purpose, differentiation, and a prerequisite, which is sufficient for basic invocation. However, because arbitrary code execution can have significant side effects and there is no output schema, more detail on expected behavior or caveats would improve completeness.

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

Parameters3/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. The tool description itself does not add parameter-level semantics beyond what the schema already provides, such as the example and use of 'return x'.

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 executes a multi-line GDScript block at runtime in the current scene context. It also explicitly distinguishes itself from evaluate_expression by mentioning support for variables, loops, and control flow, which separates it from a key sibling tool.

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 provides a direct comparison to evaluate_expression, indicating this tool is suited for complex scripts requiring variables and control flow. It also states a prerequisite (requires run_interactive), which gives practical usage context, though it doesn't explicitly enumerate all when-not-to-use scenarios.

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

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