Skip to main content
Glama

cocos_add_sliced_sprite

Add a sliced sprite to Cocos Creator scenes for scalable UI elements. This tool attaches a 9-slice sprite that stretches its center while preserving corners, enabling flexible resizing of buttons, panels, and backgrounds.

Instructions

Attach cc.Sprite with type=SLICED (9-slice). Stretches center, keeps corners.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
sprite_frame_uuidNo
color_rNo
color_gNo
color_bNo
color_aNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions the sprite's visual behavior ('Stretches center, keeps corners'), but lacks critical details: whether this is a creation/mutation operation, what permissions are needed, if it modifies existing nodes, error conditions, or the output format (though an output schema exists). For a tool with 7 parameters and no annotations, this is insufficient.

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 extremely concise—two short sentences with zero wasted words. It's front-loaded with the core action and type, followed by a clarifying detail. Every sentence earns its place by adding essential information about the tool's function.

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

Completeness2/5

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

Given the tool's complexity (7 parameters, no annotations) and the presence of an output schema, the description is incomplete. It covers the basic purpose but fails to address parameter meanings, usage context, or behavioral details beyond a high-level visual effect. For a tool that likely creates or modifies game objects, more guidance is needed.

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

Parameters2/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 adds no information about any parameters—doesn't explain what 'scene_path' or 'node_id' refer to, what 'sprite_frame_uuid' is for, or the purpose of the color parameters. This leaves all 7 parameters undocumented beyond their titles in the schema.

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 cc.Sprite') and specifies the sprite type ('type=SLICED (9-slice)'), with a brief explanation of its behavior ('Stretches center, keeps corners'). It distinguishes from sibling 'cocos_add_sprite' by specifying the sliced type, but doesn't explicitly differentiate from other sprite-related tools like 'cocos_add_filled_sprite' or 'cocos_add_tiled_sprite'.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a valid scene and node), compare to other sprite types, or indicate typical use cases (e.g., UI elements that need to scale without distorting corners).

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