Skip to main content
Glama

cocos_set_ui_theme

Apply a consistent UI theme to Cocos Creator game elements, ensuring visual harmony across labels, buttons, and sprites using built-in or custom design tokens.

Instructions

Pin a UI theme so every subsequent cocos_add_label / cocos_add_button / cocos_add_sprite call with color_preset=… / size_preset=… resolves through the same design tokens — produces a visually consistent game.

Built-in theme names: dark_game, light_minimal, neon_arcade, pastel_cozy, corporate. Pass a custom dict ({color, font_size, spacing, radius}) for something bespoke — missing preset names fall through to dark_game defaults so no lookup ever fails.

Preset vocabulary every theme MUST provide: color: primary / secondary / bg / surface / text / text_dim / success / warn / danger / border (10) font_size: title / heading / body / caption (4) spacing: xs / sm / md / lg / xl (5) radius: sm / md / lg / pill (4)

Calling with no args pins dark_game.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
themeNo
customNo
Behavior4/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 effectively describes the tool's effect (pinning a theme for subsequent UI element calls), default behavior, fallback logic, and the structure of custom themes. However, it doesn't mention whether this is a persistent configuration, if it affects existing UI elements, or any permission requirements.

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 in the first sentence. Each subsequent sentence adds valuable information (built-in themes, custom dict structure, vocabulary requirements, default behavior). While slightly dense, there's minimal waste - every sentence serves a clear purpose in explaining tool behavior.

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 tool's moderate complexity (3 parameters, no output schema, no annotations), the description provides comprehensive context about what the tool does, when to use it, parameter details, and behavioral characteristics. It explains the relationship with sibling UI element tools and provides complete documentation for both theme options. The main gap is lack of information about persistence or scope of the theme application.

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 for 3 parameters, the description compensates fully by explaining all parameters: 'project_path' is implied through context, 'theme' is detailed with built-in names and fallback behavior, and 'custom' is thoroughly documented with its structure ({color, font_size, spacing, radius}) and vocabulary requirements. The description adds significant meaning beyond the bare schema.

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 with specific verbs ('Pin a UI theme') and resources ('every subsequent cocos_add_label/cocos_add_button/cocos_add_sprite call'), distinguishing it from sibling tools that add UI elements rather than configure their styling. It explicitly explains the effect ('produces a visually consistent game') rather than just restating the name.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('so every subsequent...call with color_preset=.../size_preset=... resolves through the same design tokens') and includes clear alternatives (built-in themes vs. custom dict). It also specifies the default behavior ('Calling with no args pins dark_game') and fallback logic ('missing preset names fall through to dark_game defaults').

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