Skip to main content
Glama

cocos_add_image

Add PNG images to Cocos Creator projects by copying files and generating sprite-frame metadata for game development assets.

Instructions

Copy a PNG into the project and write a complete sprite-frame meta.

Default: assets/textures/. Set as_resource=True to put it under assets/resources/ (needed for runtime loading via resources.load()).

Returns {path, rel_path, main_uuid, sprite_frame_uuid, texture_uuid}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
src_pngYes
rel_pathNo
as_resourceNo
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool performs file copying and metadata writing (mutating operations), mentions the return value structure, and specifies the default directory and resource placement behavior. However, it doesn't address permissions, error conditions, or side effects beyond the basic operation.

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

Conciseness5/5

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

The description is efficiently structured in three sentences: purpose statement, parameter guidance, and return value. Every sentence adds essential information with zero wasted words. It's appropriately sized for the tool's complexity.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does well by explaining the operation, parameter effects, and return structure. It covers the key aspects needed to use the tool correctly, though doesn't address potential errors or edge cases. The return value documentation partially compensates for the missing output schema.

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

Parameters4/5

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

With 0% schema description coverage for 4 parameters, the description compensates well by explaining the 'as_resource' parameter's purpose and effect (placement under assets/resources/ for runtime loading). It also implies 'rel_path' usage through the default path mention, though doesn't fully document all parameters like 'project_path' and 'src_png' semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Copy a PNG into the project and write a complete sprite-frame meta'), identifies the resource (PNG file), and distinguishes from siblings by focusing on image/sprite-frame creation rather than scripts, animations, audio, or other asset types. It provides concrete details about the operation.

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?

The description provides clear context about when to use the 'as_resource' parameter (for runtime loading via resources.load()), but doesn't explicitly state when to use this tool versus alternatives like 'cocos_add_sprite' or 'cocos_add_filled_sprite'. It gives practical guidance about the default behavior and the resource placement option.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chenShengBiao/cocos-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server