Skip to main content
Glama

cocos_make_event_handler

Create event handler dictionaries for Cocos Creator components like scroll views, toggles, sliders, and edit boxes to bind component events without writing TypeScript code.

Instructions

Build a cc.EventHandler dict for component event bindings.

Use with: cocos_add_scroll_view(scroll_events=[...]), cocos_add_toggle(check_events=[...]), cocos_add_slider(slide_events=[...]), cocos_add_editbox(editing_return=[...]).

Same pattern as cocos_make_click_event but for non-Button components.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
target_node_idYes
component_nameYes
handlerYes
custom_dataNo
Behavior2/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 of behavioral disclosure. The description mentions it 'Builds a cc.EventHandler dict,' implying it creates a data structure, but does not disclose behavioral traits such as whether this is a read-only or mutating operation, any side effects, permissions needed, or error handling. For a tool with 5 parameters and no annotations, this is a significant gap in transparency.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by specific usage examples and a comparison to a sibling tool. Every sentence adds value without redundancy, making it efficient and well-structured.

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

Completeness2/5

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

Given the complexity (5 parameters, no annotations, no output schema), the description is incomplete. It explains the tool's purpose and usage context but lacks details on parameters, behavioral traits, and return values. For a tool that builds event handlers in a game development context, more information is needed to use it effectively, especially with zero schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description does not explain any of the 5 parameters (e.g., what 'scene_path', 'target_node_id', 'component_name', 'handler', or 'custom_data' mean or how to use them). It only mentions the tool's purpose and usage context, failing to compensate for the lack of schema documentation.

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's purpose: 'Build a cc.EventHandler dict for component event bindings.' It specifies the verb ('Build'), resource ('cc.EventHandler dict'), and context ('for component event bindings'). However, it does not explicitly differentiate from all siblings, though it mentions 'Same pattern as cocos_make_click_event but for non-Button components,' which helps distinguish from that specific sibling but not others like 'cocos_add_button'.

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 usage guidelines: it lists specific tools to use with (e.g., 'cocos_add_scroll_view(scroll_events=[...])') and clarifies when to use it versus alternatives by stating 'Same pattern as cocos_make_click_event but for non-Button components.' This gives clear context on when to use this tool versus the sibling 'cocos_make_click_event' and other event-related 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