Skip to main content
Glama

cocos_make_click_event

Create click event configurations for Cocos Creator buttons to trigger specific script methods when users interact with UI elements.

Instructions

Build a cc.ClickEvent dict for use with cocos_add_button's click_events.

Args: target_node_id: Node that holds the script (array index) component_name: @ccclass name (e.g. 'GameManager') handler: Method name to call (e.g. 'onStartClick')

Returns a dict to pass in click_events list of cocos_add_button.

Example workflow: evt = cocos_make_click_event(scene, gm_node, 'GameManager', 'onStart') cocos_add_button(scene, btn_node, click_events=[evt])

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
target_node_idYes
component_nameYes
handlerYes
custom_dataNo
Behavior3/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. It discloses that the tool builds a dict for use in another tool's click_events list, which implies it's a helper function with no direct side effects. However, it lacks details on error handling, validation of inputs, or whether the dict is mutable. This is adequate but leaves gaps in behavioral context.

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: it starts with the core purpose, lists key parameters with explanations, describes the return value, and provides a concise example workflow. Every sentence adds value without redundancy, making it efficient and easy to scan.

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 5 parameters with 0% schema coverage and no output schema or annotations, the description does a good job covering the tool's purpose, usage, and key parameters. However, it misses details on scene_path and custom_data, and lacks output format specifics beyond 'dict'. For a helper tool in a complex ecosystem, this is mostly complete but has minor gaps.

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 the semantics of three parameters (target_node_id, component_name, handler) in the Args section and provides an example with values, adding meaning beyond the schema. However, it omits scene_path and custom_data, leaving two parameters undocumented. This partial coverage earns a 4 for significant but incomplete compensation.

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: 'Build a cc.ClickEvent dict for use with cocos_add_button's click_events.' It specifies the verb ('Build'), resource ('cc.ClickEvent dict'), and distinguishes it from siblings by explaining its role in a workflow with cocos_add_button, unlike other tools that add components or manage scenes.

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 guidance: it states when to use this tool ('for use with cocos_add_button's click_events'), includes an example workflow showing how to integrate it with cocos_add_button, and implies alternatives by referencing a specific sibling tool (cocos_add_button) for the overall button creation process.

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