Skip to main content
Glama

attach_script

Idempotent

Attach an existing GDScript file to a node in a Godot scene, automatically saving and replacing any previous 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. Errors if scriptPath does not exist or nodePath is not found. Returns { success, nodePath, scriptPath }.

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")
Behavior5/5

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

The description discloses key behaviors beyond the idempotentHint annotation: it replaces previously attached scripts, saves automatically, and errors on missing paths. This gives the agent an accurate mental model of the tool's effects, especially that it is safe to retry (idempotent) but destructive (replaces). No contradiction with annotations.

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 three sentences, each serving a distinct purpose: purpose, usage workflow, and behavior/errors/return. It is front-loaded with the key action and uses clear, direct language. No unnecessary words.

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

Completeness5/5

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

The description is thorough for a 4-parameter tool with no output schema. It covers the operation, prerequisites, side effects, error conditions, and return format. The mention of the validate tool provides needed workflow context. Given the idempotentHint annotation, the description fully equips the agent to use the tool correctly.

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?

The input schema already provides descriptions for all parameters (100% coverage), so the baseline is 3. The description adds value by giving example formats for nodePath ('root/Player') and scriptPath ('scripts/player.gd'), and by confirming that paths are relative. This helps the agent construct correct parameter values.

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 action: 'Attach an existing GDScript file to a node in a scene.' It uses a specific verb and resource, and distinguishes from sibling tools like 'add_node' and 'connect_signal' by focusing on script attachment. The mention of replacing previous scripts adds precision.

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 usage context: 'Use after writing the script... and validating it via the validate tool.' This tells the agent the appropriate workflow step. It does not explicitly state when not to use it or list alternatives, but the context is clear. The error conditions for missing paths also guide correct usage.

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