Skip to main content
Glama

cocos_add_toast

Display transient notification pills with fade animations in Cocos Creator scenes. Configure text, duration, position, and semantic variants (info, success, warn, danger) for user feedback.

Instructions

Transient pill notification — fade in, hold, fade out.

variant picks the background:

  • "info" → surface (neutral gray/slate)

  • "success" / "warn" / "danger" → matching semantic color Text uses text preset (info) or bg (colored variants) so it always reads against the bg.

duration is total time including 0.25s fade-in + 0.25s fade-out. Minimum 0.6s (else there's no readable hold window). Clip plays once and holds invisible — toast stays in scene as a zero-opacity node.

Returns {toast_node_id, label_node_id, animation_component_id}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
parent_node_idYes
textYes
durationNo
positionNobottom
variantNoinfo
widthNo
heightNo
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. It discloses behavioral traits such as the fade-in/out timing (0.25s each), minimum duration (0.6s), that the toast stays in scene as a zero-opacity node after animation, and the return values (toast_node_id, label_node_id, animation_component_id). This covers key operational details beyond basic function.

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 well-structured and front-loaded with the core purpose, followed by parameter details and return values. Each sentence adds value, with no wasted words, making it efficient and easy to parse.

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 (8 parameters, no annotations, no output schema), the description is fairly complete. It explains the tool's behavior, key parameters, and return values, but lacks details on some parameters and does not fully address all input semantics, leaving minor gaps in context.

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?

Schema description coverage is 0%, so the description must compensate. It explains 'variant' with specific options (info, success, warn, danger) and their visual effects, and 'duration' with timing details (total time, minimum 0.6s). However, it does not cover other parameters like 'scene_path', 'parent_node_id', 'text', 'position', 'width', or 'height', 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 starts with 'Transient pill notification — fade in, hold, fade out,' which clearly states the tool's function as creating a temporary notification with specific visual behavior. It distinguishes from siblings by focusing on toast notifications rather than other UI elements 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 for transient notifications but does not explicitly state when to use this tool versus alternatives like 'cocos_add_dialog_modal' or 'cocos_add_label'. It mentions the tool's behavior (fade in/out) and parameters, but lacks explicit guidance on scenarios or exclusions.

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