Project Add Costume
project_add_costumeAdd a costume to a sprite by importing an image file or SVG markup, appending it as the sprite's highest costume number. Use when you need to extend a sprite's appearances in a Scratch project.
Instructions
Add a costume to a sprite, copying the file into the project's assets/.
Give either file (an existing .svg/.png/.jpg) or svg (SVG markup as a
string, which needs name). Appended last, so it becomes the sprite's
highest costume number.
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": {
"sprite": "<sprite>"
},
"name": "project_add_costume"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | SVG markup to write as a new costume. Requires `name`. | |
| file | No | Path to an image to import. | |
| name | No | Costume name in Scratch. Defaults to the filename without its extension. | |
| path | No | Project to modify. Defaults to the active project. | |
| sprite | Yes | Sprite name, i.e. its .gs filename without the extension. The Stage is "stage". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| name | Yes | ||
| path | Yes | ||
| exists | Yes |