Skip to main content
Glama

load_sprite

Idempotent

Assigns a texture file to an existing Sprite2D, Sprite3D, or TextureRect node and saves the scene automatically. Use it to update sprite visuals; for new nodes, set texture in add_node properties.

Instructions

Set the texture on an existing Sprite2D, Sprite3D or TextureRect. For a new node, pass texture in add_node properties instead. Saves automatically. texturePath must be a file under projectPath. Returns: nodePath, nodeType and texturePath, read back from the node after the assignment. Errors if the node is not one of those three classes or the texture file does not exist. Errors while a runtime session is live on this project.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectPath": "<projectPath>",
      "scenePath": "<scenePath>",
      "nodePath": "<nodePath>",
      "texturePath": "<texturePath>"
    },
    "name": "load_sprite"
  }
}

Input Schema

NameRequiredDescriptionDefault
nodePathYesPath to the target node from scene root (e.g. "root/Player/Sprite2D")
scenePathYesScene file path relative to the project
projectPathYesPath to the Godot project directory
texturePathYesPath to the texture file relative to the project (e.g. "assets/player.png")

Output Schema

NameRequiredDescriptionDefault
nodePathYes
nodeTypeYes
warningsNo
texturePathYesProject-relative path of the texture the node holds after the assignment.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.0.1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "nodePath": {
      +      "type": "string"
      +    },
      +    "nodeType": {
      +      "type": "string"
      +    },
      +    "texturePath": {
      +      "description": "Project-relative path of the texture the node holds after the assignment.",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "nodePath",
      +    "nodeType",
      +    "texturePath"
      +  ],
      +  "type": "object"
      +}
  2. Addedv3.1.1
  3. Removedv3.0.0
  4. Addedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare idempotentHint, so the description carries most of the behavioral load and does so well: it discloses the automatic save, the read-back verification of the assigned value, the two failure modes (wrong node class, missing texture file), and the live-session restriction. This is well beyond what the annotation conveys.

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?

Front-loads the action, then the alternative, the side effect, the constraint, the return shape, and the error cases in that order. Every sentence carries distinct information with no restatement of the tool name or schema.

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?

For a four-parameter mutation tool the definition covers action, preconditions, side effects, return values and failure modes, so nothing an agent needs before calling is missing. The output schema exists, and the description's brief return summary is a bonus rather than a gap-filler.

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?

Schema coverage is already 100%, and the description still adds meaning: texturePath must resolve to a file under projectPath, and the value is read back from the node after assignment. It stops short of explaining scenePath/nodePath interaction, which the schema covers anyway.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a concrete verb and resource ("Set the texture on an existing Sprite2D, Sprite3D or TextureRect") and explicitly narrows scope by node class, so an agent can rule it out for other node types. It also separates itself from add_node for the new-node case, but does not clarify its relationship to the more general set_node_properties sibling.

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?

Gives an explicit alternative for the adjacent case ("For a new node, pass texture in add_node properties instead") and a clear when-not condition (errors while a runtime session is live on this project). The preconditions for a successful call are all stated up front.

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