load_sprite
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
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | Yes | Path to the target node from scene root (e.g. "root/Player/Sprite2D") | |
| scenePath | Yes | Scene file path relative to the project | |
| projectPath | Yes | Path to the Godot project directory | |
| texturePath | Yes | Path to the texture file relative to the project (e.g. "assets/player.png") |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodePath | Yes | ||
| nodeType | Yes | ||
| warnings | No | ||
| texturePath | Yes | Project-relative path of the texture the node holds after the assignment. |