create_resource
Creates a Godot .tres resource file from a Resource class or GDScript and sets property values, with optional overwrite for existing files.
Instructions
Create a .tres resource file from an engine Resource class or a GDScript resource script (class_name or path), with property values set. Values are checked against declared types as in set_node_properties (Property Values in docs/tools.md). Refuses an existing file unless overwrite is true. Returns: resourcePath, resourceType, scriptPath and properties read back from the saved file. Errors on an unknown type or property, and 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>",
"resourcePath": "<resourcePath>",
"type": "<type>"
},
"name": "create_resource"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Engine Resource class such as "StyleBoxFlat", a registered class_name, or a GDScript path such as "items/item_stats.gd". A class_name is known only after the editor or an import has scanned the project. | |
| overwrite | No | Replace an existing file at resourcePath (default: false). | |
| properties | No | Property values to set, keyed by property name as written, with the same value rules as set_node_properties. script and resource_path are refused. | |
| projectPath | Yes | Path to the Godot project directory | |
| resourcePath | Yes | Path of the .tres file inside the project, e.g. "items/sword.tres". Created with its folders. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| warnings | No | ||
| properties | Yes | Each property the call set, read back from the saved file, in the shapes set_node_properties accepts. | |
| scriptPath | Yes | Project-relative path of its script, or null. | |
| resourcePath | Yes | Project-relative path of the .tres file written. | |
| resourceType | Yes | Engine class of the saved resource (Resource for a script class). |