Skip to main content
Glama

cocos_add_card_grid

Add a grid of interactive cards to Cocos Creator scenes for level selection, shop interfaces, or character pickers. Configure card appearance and wire click events for user interaction.

Instructions

Grid of tappable cards — level select, shop, character picker.

Each cards[i] is::

{"title": str,
 "subtitle": str | None,
 "icon_sprite_frame_uuid": str | None,
 "variant": "primary" | "surface",    # bg color, default "surface"
 "click_events": [...] | None}

Whole card is the button (tap anywhere). Title + subtitle auto- pick contrasting text colors for the chosen variant ("primary" variant gets bg-colored text; "surface" gets text-colored). Extras wrap to new rows when count > columns.

Returns {grid_node_id, cards: [{node_id, title_node_id, subtitle_node_id, icon_node_id, button_component_id}, ...]}. Wire per-card click by passing click_events in each spec.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
parent_node_idYes
cardsYes
columnsNo
card_widthNo
card_heightNo
spacingNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by describing key behaviors: whole card acts as button, automatic text color contrast based on variant, extras wrap to new rows, and return structure. It doesn't mention permissions, rate limits, or mutation effects, but covers core UI behavior adequately.

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 efficiently structured with clear sections: purpose, card structure, behavior, return values, and click wiring. Every sentence adds value, though the technical formatting (:: and # comments) slightly reduces readability.

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

Completeness4/5

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

For a 7-parameter tool with no annotations and no output schema, the description provides substantial context: purpose, parameter semantics, behavior, and return structure. It could mention error conditions or performance considerations but covers the essentials well given the complexity.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 7 parameters, the description compensates excellently by explaining the 'cards' array structure in detail (title, subtitle, icon, variant, click_events) and mentioning layout behavior (wrapping when count > columns). It adds crucial meaning beyond the bare schema property names.

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 tool creates a 'Grid of tappable cards' with specific use cases (level select, shop, character picker). It distinguishes from sibling tools by focusing on card grid creation rather than other UI components like buttons, labels, or dialogs listed in the sibling tools.

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 through example contexts (level select, shop, character picker) but doesn't explicitly state when to use this tool versus alternatives like 'cocos_add_button' or 'cocos_add_main_menu'. No explicit exclusions or prerequisites are mentioned.

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