Skip to main content
Glama

create_resource

Destructive

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

NameRequiredDescriptionDefault
typeYesEngine 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.
overwriteNoReplace an existing file at resourcePath (default: false).
propertiesNoProperty values to set, keyed by property name as written, with the same value rules as set_node_properties. script and resource_path are refused.
projectPathYesPath to the Godot project directory
resourcePathYesPath of the .tres file inside the project, e.g. "items/sword.tres". Created with its folders.

Output Schema

NameRequiredDescriptionDefault
warningsNo
propertiesYesEach property the call set, read back from the saved file, in the shapes set_node_properties accepts.
scriptPathYesProject-relative path of its script, or null.
resourcePathYesProject-relative path of the .tres file written.
resourceTypeYesEngine class of the saved resource (Resource for a script class).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.1

TDQS

A3.6/5.0
Behavior3/5

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

The description carries substantial behavioral detail beyond the single destructiveHint annotation: overwrite gating, type-validation behavior, and the live-session refusal. However, it never explains what overwrite destroys (the previous file contents) or that the destructiveHint applies to that path, leaving the safety story incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense and front-loaded, with the create action first and the constraints following. The explicit returns list (resourcePath, resourceType, scriptPath, properties) duplicates the output schema and is the one sentence that does not fully earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the main creation path, overwrite semantics, and error conditions for a mutation tool. It omits what happens to an existing file's contents on overwrite and any permission or project-state prerequisites beyond the live-session guard, which matters given the destructiveHint.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the schema documents every parameter including the script/resource_path refusal and the folder creation behavior. The description adds real value only for type (a class_name is known only after the editor or an import has scanned the project), which is genuinely non-obvious. Elsewhere it restates schema content.

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 specific verb and resource: create a .tres file from an engine Resource class or GDScript script, with property values set, and enumerates the accepted type forms. It implicitly separates itself from set_resource_properties by scoping to file creation, but never names a sibling it is not, so it falls short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete preconditions and failure modes: refuses an existing file unless overwrite is true, errors on unknown type or property, and errors while a runtime session is live on the project. It also points to set_node_properties for the value rules. It stops short of explicitly routing the agent to set_resource_properties for editing an existing resource.

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