Skip to main content
Glama

cocos_set_node_layer

Set a node's layer bitmask in Cocos Creator scenes to control rendering and interaction groups, using predefined values like UI_2D or DEFAULT.

Instructions

Set a node's layer bitmask. Common: UI_2D=33554432, DEFAULT=1073741824.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
layerYes

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 of behavioral disclosure. It implies a mutation ('Set'), but does not specify whether this requires specific permissions, if changes are reversible, what happens to existing layer settings, or any side effects like performance impacts. The mention of 'Common' layer values adds some context but falls short of explaining the tool's full behavior.

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 and front-loaded, consisting of a single sentence that directly states the tool's purpose followed by helpful examples. Every word serves a clear purpose, with no redundant or unnecessary information, making it easy to parse quickly.

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 tool's moderate complexity (3 parameters, mutation operation) and the presence of an output schema (which reduces the need to describe return values), the description is partially complete. It covers the core action and provides layer examples, but lacks details on behavioral aspects, usage context, and full parameter semantics, making it adequate but with clear gaps.

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, the description must compensate for the lack of parameter documentation. It clarifies the 'layer' parameter by providing common examples (UI_2D=33554432, DEFAULT=1073741824), which adds meaningful semantics beyond the schema's basic type. However, it does not explain 'scene_path' or 'node_id', leaving two of the three parameters without additional context.

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 ('Set a node's layer bitmask') and resource ('node'), distinguishing it from sibling tools like 'cocos_set_node_position' or 'cocos_set_node_active' which modify different node properties. It provides concrete examples of layer values (UI_2D=33554432, DEFAULT=1073741824), making the purpose highly specific and actionable.

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?

The description offers no guidance on when to use this tool versus alternatives, such as other node-setting tools or how layer bitmasks interact with other Cocos features. It lacks context about prerequisites, like whether the node must exist or be in a specific state, and does not mention any exclusions or typical use cases.

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