Skip to main content
Glama
lightblink

Cocos Creator Local MCP

by lightblink

Create Cocos Component Script

cocos_local_create_component_script

Creates a Cocos Creator 3.8 TypeScript component script with ccclass decorator, typed properties, and lifecycle method stubs for rapid development.

Instructions

Create a Cocos Creator 3.8 TypeScript Component script with ccclass, typed properties, and lifecycle stubs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseClassNoComponent
classNameYesCocos component class name, e.g. GameManager or PlayerController.
lifecycleNo
overwriteNo
propertiesNo
scriptPathNoPath under project assets, e.g. assets/scripts/GameManager.ts. Defaults to assets/scripts/<className>.ts.
descriptionNoOptional short comment describing component responsibility.
projectRootYes
Behavior2/5

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

No annotations are provided, so the description must fully convey behavioral aspects. It mentions the script includes ccclass, typed properties, and lifecycle stubs, but does not disclose side effects (e.g., file creation, overwrite behavior), error conditions, or required permissions. Critical gaps exist for a creation tool.

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 a single 15-word sentence that immediately conveys the tool's purpose. No extraneous information is present, making it efficient and front-loaded.

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 tool has 8 parameters, no output schema, no annotations, and 38% schema coverage, the description is too sparse. It omits essential context about parameter usage, outcome, and error handling, leaving significant gaps for the agent.

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 only 38%, and the tool description does not add parameter-specific details. It hints at lifecycle and properties but fails to explain parameters like overwrite, scriptPath, projectRoot, or baseClass. The high-level summary does not compensate for the low schema coverage.

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 specifies 'Create a Cocos Creator 3.8 TypeScript Component script with ccclass, typed properties, and lifecycle stubs.' It clearly states the verb (Create) and the resource (Component script), and distinguishes from sibling tools that create other Cocos artifacts like scenes or projects.

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

Usage Guidelines4/5

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

The description implies usage for creating component scripts, and the tool name and title make it clear. However, it does not explicitly state when to use this tool versus alternatives like cocos_local_create_scene_from_template, but the context of sibling tools and the title provide sufficient clarity.

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/lightblink/cocos-creator-local-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server