Skip to main content
Glama

cocos_scaffold_ui_screen

Generate full-screen UI controllers for Cocos Creator games, including menu, settings, pause, and game-over screens that integrate with the GameLoop system.

Instructions

Generate Screen.ts — full-screen UI controller tied to GameLoop.

Kinds (all subscribe to the GameLoop singleton — scaffold that first so references resolve):

"menu" — title screen. @property startButton, shows when GameLoop.current == 'menu', click → go('play') + hide. "settings" — toggleable panel. @property closeButton + exposes .show() / .hide() / .toggle() for external callers. "pause" — overlay. Listens for Escape key via cc.input directly (doesn't require InputManager scaffolded). @property resumeButton. Toggles 'pause' ↔ 'play'. "game_over" — shown when GameLoop.current == 'over'. Reads GameScore.I.current + .high into @property scoreLabel / highLabel. @property restartButton → GameScore.reset() + GameLoop.go('play').

Every variant toggles @property rootNode.active for show/hide (whole-subtree toggle beats per-node UIOpacity for full screens).

Default rel_path per kind: MenuScreen.ts / SettingsScreen.ts / PauseScreen.ts / GameOverScreen.ts.

Returns {path, rel_path, uuid_standard, uuid_compressed}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
kindNomenu
rel_pathNo
Behavior3/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 describes what gets generated (TypeScript files with specific properties and behaviors), mentions the toggle mechanism (rootNode.active), and specifies the return format. However, it doesn't cover important behavioral aspects like error handling, file overwriting behavior, or permission requirements for writing to project_path.

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 appropriately sized and front-loaded with the core purpose. The bullet-point format for different kinds is efficient, though some sentences could be more concise (e.g., 'whole-subtree toggle beats per-node UIOpacity for full screens' could be simplified). Overall, most content earns its place.

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 3-parameter tool with no annotations and no output schema, the description provides substantial context about behavior, parameters, and integration requirements. It explains the return format and GameLoop dependency. The main gap is lack of error handling information, but otherwise it's quite complete for a scaffolding tool.

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 3 parameters, the description provides excellent semantic context. It explains that 'kind' accepts specific values (menu, settings, pause, game_over) with detailed behavior for each, clarifies that 'rel_path' has default values per kind, and implies 'project_path' is where the files will be generated. This fully compensates for the lack of schema documentation.

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 generates a full-screen UI controller file tied to GameLoop, specifying the exact file format (<Kind>Screen.ts) and distinguishing it from sibling tools that add components rather than scaffold full controllers. It explicitly lists four specific kinds (menu, settings, pause, game_over) with their distinct purposes.

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 about when to use this tool (to generate UI screens for GameLoop integration) and mentions the prerequisite to scaffold GameLoop first so references resolve. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the many sibling tools.

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