Skip to main content
Glama

attach_script

Idempotent

Attach a GDScript file to a node in a Godot scene, replacing any existing script and saving automatically. Use after writing and validating the script.

Instructions

Attach an existing GDScript file to a node in a scene. Use after writing the script with the standard file tools and validating it via the validate tool. Replaces any previously attached script. Saves automatically. Returns: success with the resolved nodePath and scriptPath that were attached. Errors if scriptPath does not exist or nodePath is not found.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the Godot project directory
scenePathYesScene file path relative to the project
nodePathYesNode path from scene root (e.g. "root/Player")
scriptPathYesPath to the GDScript file relative to the project (e.g. "scripts/player.gd")

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNo
nodePathNo
scriptPathNo
Behavior4/5

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

The description discloses key behavioral traits: it replaces any previously attached script, saves automatically, and lists error conditions (scriptPath missing, nodePath not found). The idempotentHint annotation is consistent, and the description adds context about the replacement behavior beyond the annotation.

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 concise and well-structured: it states the purpose first, then provides usage guidance, behavior details, and return/error information. Every sentence adds value, and there is no redundancy.

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?

Given that there is an output schema (mentioned in context) and annotations, the description adequately covers usage, behavioral side effects, and error cases. It is complete enough for an agent to correctly invoke the tool without needing additional information.

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?

The input schema has 100% coverage with descriptions for each parameter. The description adds some context (e.g., scriptPath must exist, nodePath must be found) but does not significantly enhance understanding beyond the schema. Baseline 3 is appropriate.

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's purpose: attaching an existing GDScript file to a node in a scene. The verb 'attach' is specific, and the resource is well-defined. It effectively distinguishes this from sibling tools like add_autoload or connect_signal by focusing on script attachment.

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 explicit guidance on when to use the tool: after writing the script with standard file tools and validating it. This sets a clear workflow context. However, it does not explicitly state when not to use it or mention alternatives, though the workflow hint is valuable.

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/Erodenn/godot-mcp-runtime'

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