Skip to main content
Glama

Run GDScript

exec
Destructive

Run a GDScript snippet in the Godot editor or running game when no dedicated action fits—use for bulk procedural generation, one-off fixes, or complex queries.

Instructions

Escape hatch: run a GDScript snippet in the editor or in the running game when no dedicated action fits (bulk procedural generation, one-off fixes, complex queries). Prefer dedicated tools; file changes made here are still tracked by changesets.

Actions:

  • editor: {code} body of func run(editor: EditorInterface, scene: Node, forge) -> Variant; return a value. forge.find_node(path), forge.begin(name)/forge.commit() for undoable edits.

  • game: {code} body of func run(tree: SceneTree, scene: Node) in the running game; return a value.

  • eval: {expression, path?} evaluate one expression in the editor with a node as self.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoGDScript statements (tabs or spaces, consistently).
pathNoNode path relative to the scene root ('.' = root, 'Player/Sprite2D', '%Unique'), or a res:// file path, depending on the action.
actionYesWhat to do. See the tool description for each action's parameters.
expressionNoSingle Godot Expression.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered. The description adds useful context beyond annotations: file changes are tracked by changesets, and forge.begin/commit enables undoable edits. It does not detail error behavior or return payload shape, so it falls just short of a 5.

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 front-loaded with the escape-hatch purpose and preference for dedicated tools, then uses a compact action list. Every sentence and bullet earns its place by explaining a distinct execution mode or parameter convention. There is no redundant or filler content.

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 a complex code-execution tool with three modes, the description covers when to use it, the side-effect tracking, undoability via forge, and action-specific parameters. With no output schema, it could say more about what the tool returns or how errors surface, but it gives the agent enough to invoke it correctly.

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

Parameters5/5

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

The input schema has 100% description coverage, but the description is essential because the action parameter explicitly redirects to it. It explains each action's parameter shape, including the expected function body signatures for editor and game, return semantics, and forge helper methods. This adds substantial meaning beyond the schema's field descriptions.

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 action and scope: run a GDScript snippet in the editor or running game as an escape hatch. It explicitly positions itself against sibling tools by saying to prefer dedicated tools when one fits. An agent can identify its purpose and differentiation immediately.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance ('when no dedicated action fits') and example use cases (bulk procedural generation, one-off fixes, complex queries). It also states the general alternative preference: 'Prefer dedicated tools.' This is about as clear as usage guidance gets.

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