Skip to main content
Glama

cocos_add_layout

Add layout components to Cocos Creator nodes to arrange child elements horizontally, vertically, or in grids with customizable spacing and padding.

Instructions

Attach cc.Layout. layout_type: 0=NONE, 1=HORIZONTAL, 2=VERTICAL, 3=GRID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
layout_typeNo
spacing_xNo
spacing_yNo
padding_topNo
padding_bottomNo
padding_leftNo
padding_rightNo
resize_modeNo
h_directionNo
v_directionNo

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 the full burden of behavioral disclosure. It states the tool attaches a layout but doesn't describe what that entails—whether it modifies existing nodes, requires specific permissions, has side effects, or how it interacts with the scene. For a mutation tool with 12 parameters, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that directly states the tool's purpose and provides key enum values for layout_type. It's front-loaded with the main action and avoids unnecessary words, though it could be slightly more structured (e.g., separating the enum explanation).

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 complexity (12 parameters, mutation tool, no annotations, schema coverage 0%), the description is inadequate. It lacks details on parameter meanings, behavioral traits, output (though an output schema exists, the description doesn't hint at it), and usage context. For a tool with many parameters and no annotation support, more comprehensive 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 schema provides no parameter details. The description only explains 'layout_type' with enum values (0=NONE, etc.), adding minimal semantics for 1 of 12 parameters. It doesn't clarify the purpose of other parameters like spacing, padding, resize_mode, or directions, leaving most undocumented.

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') and resource ('cc.Layout'), specifying it attaches a layout component. It distinguishes from siblings by focusing on layout attachment rather than other component types like scripts or animations. However, it doesn't explicitly differentiate from other layout-related tools (none appear in the sibling list).

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, context, or comparisons with other layout or UI tools. It only defines the tool's function without usage context.

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