Skip to main content
Glama

cocos_add_main_menu

Add a full-screen vertical main menu with background, title, and stacked buttons to Cocos Creator scenes for game navigation and settings access.

Instructions

Build a full-screen vertical main menu: bg + title + stacked buttons.

Buttons use same shape as cocos_add_dialog_modal. Default is a "Start" (primary) + "Settings" (ghost) pair.

Typical flow::

scene = cocos_create_scene(...) cocos_set_ui_theme(project, theme="dark_game") cocos_add_main_menu(scene, scene["canvas_node_id"], "Flappy Bird", buttons=[{"text": "Start", "variant": "primary", "click_events": [click_evt]}])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
parent_node_idYes
titleYes
buttonsNo
button_widthNo
button_heightNo
Behavior3/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 describes the tool's behavior by detailing the menu structure (full-screen, vertical, with background, title, and buttons) and default button configuration, but lacks information on permissions, error handling, or side effects like scene modification impacts. The example flow adds practical context but does not fully cover behavioral traits.

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 front-loaded with the core purpose, followed by specific details and a practical example. Every sentence adds value without redundancy, making it efficient and well-structured for quick understanding.

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?

Given the complexity of a UI-building tool with 6 parameters, no annotations, and no output schema, the description is fairly complete: it explains the tool's purpose, provides usage guidelines with an example, and covers parameter semantics partially. However, it lacks details on return values or error conditions, which would enhance completeness for this type of tool.

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 and 6 parameters, the description compensates by explaining key parameters: it mentions 'title' and 'buttons' in the example, implies 'scene_path' and 'parent_node_id' through the flow, and references button dimensions via 'button_width' and 'button_height' defaults. However, it does not detail all parameters (e.g., exact usage of 'scene_path'), leaving some gaps.

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's purpose: 'Build a full-screen vertical main menu: bg + title + stacked buttons.' It specifies the verb ('Build'), resource ('main menu'), and key components, distinguishing it from sibling tools like 'cocos_add_dialog_modal' by referencing it for button shape but focusing on a full-screen menu structure.

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

Usage Guidelines4/5

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

The description provides clear context for usage with a 'Typical flow' example, showing how to integrate it into a scene creation process and referencing sibling tools like 'cocos_create_scene' and 'cocos_set_ui_theme'. However, it does not explicitly state when not to use this tool or mention alternatives, such as other UI components from the sibling list.

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