Skip to main content
Glama

cocos_add_hud_bar

Add a horizontal HUD bar to display game information like score and level. Configure text labels and spacers, then pin it to the top or bottom of the screen for endless-runner style games.

Instructions

Build a horizontal HUD bar pinned to the top (or bottom).

items is a list of:

  • {"kind": "label", "text": str, "size_preset": str, "color_preset": str, "width": int, "align": str} — text cell

  • {"kind": "spacer", "width": int} — blank gap

Default is a Score label + spacer + Lv label, good for endless- runner style games. side: "top" (default) or "bottom".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
parent_node_idYes
itemsNo
heightNo
sideNotop
Behavior3/5

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

With no annotations provided, the description carries full burden. It describes what the tool creates (a HUD bar) and its positioning behavior (pinned to top/bottom), but doesn't disclose important behavioral traits like whether this is a read-only or mutating operation, what permissions are needed, error conditions, or how it interacts with the scene. The mention of default configuration adds some context, but key behavioral aspects remain undocumented.

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 efficiently structured with clear sections: purpose statement, items parameter details, default configuration, and side parameter explanation. Every sentence adds value with no wasted words. The technical details are presented in a readable format with appropriate line breaks and code formatting for the items structure.

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

Completeness3/5

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

Given the tool's complexity (5 parameters, no annotations, no output schema), the description provides good coverage of the items parameter but leaves other parameters unexplained. It doesn't describe what the tool returns or how errors are handled. For a tool that presumably creates UI elements in a game engine context, more information about integration with the scene system would be helpful.

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, the description must compensate. It provides excellent semantic information for the 'items' parameter (detailing the structure of label and spacer objects with their properties) and explains the 'side' parameter options. However, it doesn't explain the purpose of 'scene_path', 'parent_node_id', or 'height' parameters, leaving 3 of 5 parameters without semantic clarification in the description.

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 tool builds a horizontal HUD bar pinned to top or bottom, specifying the resource (HUD bar) and action (build). It distinguishes from siblings by focusing on HUD bar creation rather than other UI elements like buttons or labels. However, it doesn't explicitly contrast with similar layout tools like 'cocos_add_layout' or 'cocos_add_widget'.

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 for creating HUD bars in games, mentioning 'good for endless-runner style games' as a default configuration. It provides some context about when the default configuration is appropriate but doesn't explicitly state when to use this tool versus alternatives like 'cocos_add_layout' or 'cocos_add_widget' for similar UI positioning tasks.

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