Skip to main content
Glama

Script Attach

script_attach

Attach a GDScript or C# script to a scene node, replacing any existing script. Undoable.

Instructions

Attach a script to a node in the scene tree.

Replaces any existing script on the node. Undoable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesScene path of the node (e.g. "/Main/Player").
session_idNoOptional Godot session to target. Empty = active session.
script_pathYesres:// path of the .gd (e.g. "res://scripts/player.gd"). A .cs requires a .NET-enabled editor build; other builds get a clear error. Build the assembly before expecting executable behavior.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.2.1
    • changedInput schema / properties / script_path / description
      Previous value: -"res:// path of the .gd (e.g. \"res://scripts/player.gd\")."New value: +"res:// path of the .gd (e.g. \"res://scripts/player.gd\").\nA .cs requires a .NET-enabled editor build; other builds get a\nclear error. Build the assembly before expecting executable behavior."
  2. Addedv3.1.4
  3. Removedv3.0.7
  4. First observedv2.9.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly warns that the tool 'replaces any existing script on the node' and states it is 'undoable,' which is valuable safety-relevant context beyond what the schema provides.

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 wasted words. It front-loads the primary action, then immediately states the key behavioral consequences. Every sentence earns its place.

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?

The description is complete for a simple attach operation: it states the action, the destructive replacement behavior, and undoability. The full input schema and existing output schema cover the remaining technical details. It could be slightly stronger with explicit sibling differentiation, but nothing critical is missing.

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 description coverage is 100%, so the schema fully documents all parameters. The description does not add extra parameter semantics, but it doesn't need to; the baseline of 3 applies because the schema handles the burden.

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 uses a specific verb and resource: 'Attach a script to a node in the scene tree.' This clearly distinguishes it from sibling tools like script_create or script_patch, which serve different purposes. It is not a tautology of the tool name.

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

Usage Guidelines3/5

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

The description implies usage: use this when you want to attach a pre-existing script to a node. However, it does not explicitly state when to choose this over alternatives like script_create or script_manage, nor does it mention any exclusions or prerequisites.

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