Skip to main content
Glama

cocos_add_mask

Attach a mask component to nodes in Cocos Creator scenes to define visible areas using rectangle, ellipse, or stencil shapes for visual effects.

Instructions

Attach cc.Mask. mask_type: 0=RECT, 1=ELLIPSE, 2=GRAPHICS_STENCIL, 3=SPRITE_STENCIL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
mask_typeNo
invertedNo
segmentsNo

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 the full burden. It mentions 'Attach cc.Mask' but doesn't disclose behavioral traits like whether this modifies an existing node, requires specific permissions, has side effects, or how it interacts with other components. The mask_type values add some context, but critical details like error handling or performance impacts are missing.

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?

The description is brief and front-loaded with the main action, but it could be more structured. The single sentence efficiently states the tool's function and mask_type details, with no wasted words. However, it lacks separation of purpose from parameter info, slightly reducing clarity.

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 5 parameters with 0% schema coverage, no annotations, and an output schema (which isn't described), the description is incomplete. It doesn't explain the tool's role in the Cocos ecosystem, expected inputs beyond mask_type, or what the output might be. For a tool that likely modifies scene nodes, this leaves significant gaps for an AI agent.

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 only explains 'mask_type' with numeric codes (0-3), leaving 'scene_path', 'node_id', 'inverted', and 'segments' undocumented. The description adds minimal value beyond the schema, failing to clarify parameter meanings or usage, such as what 'segments' does for ellipse masks.

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

Purpose3/5

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

The description states the action ('Attach cc.Mask') and resource (mask), but is vague about the context—it doesn't specify what is being masked (e.g., a node in a scene) or how this differs from sibling tools like 'cocos_add_graphics' or 'cocos_add_sprite'. It provides mask_type values, but lacks a clear overall purpose statement.

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 given on when to use this tool versus alternatives. The description lists mask_type options but doesn't explain their use cases or prerequisites. With many sibling tools for adding components, there's no indication of when masking is appropriate, such as for UI effects or visual clipping.

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