set_resource_properties
Updates named property values in an existing .tres resource file and saves it. Validates each value against its declared type and writes nothing if any name or value is invalid.
Instructions
Set property values in an existing .tres resource file and save it. Properties not named, sub-resources and uids stay as the file has them. A Dictionary or Array value replaces the stored one whole; send every key. Values are checked against declared types as in set_node_properties (Property Values in docs/tools.md); one invalid name or value errors and writes nothing. Returns: resourcePath, resourceType, scriptPath, the named properties read back. Errors while a runtime session is live.
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>",
"properties": "<properties>"
},
"name": "set_resource_properties"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| properties | Yes | Property values to set, at least one, 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". |
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). |