Skip to main content
Glama

cocos_add_sprite

Attach a sprite component to a Cocos Creator node using a sprite frame UUID, configure size mode, and apply color tinting or theme presets for visual customization.

Instructions

Attach a cc.Sprite to a node.

sprite_frame_uuid is the <uuid>@f9941 form returned by cocos_add_image or cocos_get_sprite_frame_uuid. size_mode: 0=CUSTOM (use UITransform's contentSize), 1=TRIMMED, 2=RAW. color_preset: pick from the project's UI theme (e.g. "primary", "surface") to tint the sprite — overrides the explicit RGBA args.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
sprite_frame_uuidNo
size_modeNo
color_rNo
color_gNo
color_bNo
color_aNo
color_presetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes what the tool does (attaching a sprite with specific parameters) but lacks critical behavioral details: it doesn't mention whether this is a mutation (likely yes, but not stated), what permissions are needed, error conditions, or what the output contains. The description adds some context about parameter interactions (e.g., color_preset overrides RGBA), but overall behavioral disclosure is insufficient for a tool with 9 parameters and no annotation support.

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 highly concise and well-structured: a clear purpose statement followed by bullet-like explanations of specific parameters. Every sentence adds value, with no wasted words. It's front-loaded with the main action and efficiently addresses complex parameter semantics.

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?

Given the complexity (9 parameters, 0% schema coverage, no annotations) and the presence of an output schema (which reduces need to describe returns), the description is partially complete. It explains some parameter semantics well but misses behavioral context (mutation effects, error handling) and doesn't cover all parameters. For a tool with this many inputs and no annotations, more comprehensive guidance would be expected.

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?

Schema description coverage is 0%, so the description must compensate. It provides meaningful explanations for three key parameters: sprite_frame_uuid (format and sources), size_mode (enum values 0-2 with meanings), and color_preset (purpose and effect). This adds significant value beyond the bare schema, though it doesn't cover all 9 parameters (e.g., scene_path, node_id, color RGBA components remain unexplained in the description).

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?

The description clearly states the action ('Attach a cc.Sprite to a node') and specifies the resource (a sprite). It distinguishes from some siblings like 'cocos_add_filled_sprite' or 'cocos_add_sliced_sprite' by focusing on general sprite attachment, but doesn't explicitly differentiate from all similar tools in the extensive list.

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

Usage Guidelines3/5

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

The description implies usage by referencing other tools ('cocos_add_image' or 'cocos_get_sprite_frame_uuid') for obtaining the sprite_frame_uuid, suggesting when to prepare inputs. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'cocos_add_filled_sprite' or other sprite-related tools, nor does it mention prerequisites or exclusions.

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