Skip to main content
Glama

cocos_scaffold_enemy_ai

Generate starter TypeScript files for enemy AI behaviors in Cocos Creator projects, including patrol, chase, and shooting patterns with configurable properties.

Instructions

Generate Enemy{Kind}.ts — common enemy-behaviour starters.

"patrol" — oscillates between @property Nodes patrolA ↔ patrolB. Flips optional @property mirrorSprite on direction change. Exposes @property speed. "chase" — tracks @property target Node when within chaseRadius; gives up past loseAggroRadius (hysteresis prevents aggro flicker). Kinematic setPosition update. @property moveSpeed. "shoot" — stationary turret. Every @property fireInterval s, instantiates @property bulletPrefab with velocity toward @property target if within @property range.

Default rel_path per kind: EnemyPatrol.ts / EnemyChase.ts / EnemyShoot.ts. Returns the usual four keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
kindNopatrol
rel_pathNo
Behavior3/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 like file generation, default paths, and return format ('Returns the usual four keys'), but lacks details on permissions, error handling, or side effects. It adequately describes what the tool does without contradictions, but could be more comprehensive for a code-generation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the main purpose, followed by bullet-like explanations for each behavior kind and concluding with default paths and return info. It is appropriately sized with no wasted sentences, though the formatting with quotes and backticks could be slightly cleaner for readability.

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 no annotations, 0% schema coverage, and no output schema, the description does a decent job by explaining parameters and behaviors. However, it lacks details on the return value ('the usual four keys' is vague), error conditions, or integration with the project context, leaving some gaps for a tool with 3 parameters and code-generation complexity.

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

Parameters5/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 effectively explains the semantics of the 'kind' parameter by detailing the three options (patrol, chase, shoot) with their properties and behaviors, and clarifies 'rel_path' with default values per kind. This adds significant meaning beyond the bare schema, fully documenting parameter usage.

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 generates enemy behavior starter files with specific verbs ('Generate Enemy{Kind}.ts — common enemy-behaviour starters') and distinguishes itself from siblings by focusing on AI scaffolding rather than UI components or asset management. It explicitly lists the three behavior types (patrol, chase, shoot) with detailed mechanics, making the purpose highly specific and differentiated.

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 provides clear context for when to use this tool (to create enemy AI behavior starters) and implies usage through the detailed behavior explanations. However, it does not explicitly state when not to use it or name alternatives among siblings, such as other scaffolding tools like 'cocos_scaffold_player_controller', leaving some guidance gaps.

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