Skip to main content
Glama

cocos_scaffold_spawner

Generate spawner scripts for Cocos Creator games to automatically instantiate prefabs on timers or player proximity triggers with configurable limits and callbacks.

Instructions

Generate Spawner{Kind}.ts — instantiate @property prefab on a trigger.

"time" — every @property interval s, up to @property maxActive concurrent. Jitters spawn position within @property spawnBoxSize half-extents. Over cap: despawn oldest (destroy + shift queue). "proximity" — spawn when @property player is within @property triggerRadius, respecting @property cooldown seconds and @property maxActive cap.

Both variants parent spawned nodes under this.node.parent (NOT the spawner itself — inheriting the spawner's transform is usually wrong) and fire optional @property onSpawn callback post- addChild so game code can attach health, patrol targets, etc.

Default rel_path: SpawnerTime.ts / SpawnerProximity.ts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
kindNotime
rel_pathNo
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 of behavioral disclosure. It effectively describes key behaviors: the tool generates TypeScript files, details spawning mechanics (jitter, queue management, parenting rules), and mentions callback execution. However, it doesn't cover potential side effects like file overwriting or error conditions, leaving some gaps in behavioral understanding.

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 efficiently structured with clear sections: purpose statement, variant explanations, parenting behavior, and default paths. Every sentence adds value, though the formatting with quotes and backticks could be slightly cleaner. It's appropriately sized for the complexity without unnecessary elaboration.

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?

For a tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description provides strong contextual completeness. It covers purpose, variants, behaviors, parenting rules, and parameter implications. The main gap is lack of explicit error handling or output format details, but given the tool's nature (file generation), this is reasonably complete.

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?

Given 0% schema description coverage, the description compensates by explaining parameter semantics beyond the schema. It clarifies that 'kind' accepts 'time' or 'proximity' with detailed behavior for each, explains 'rel_path' defaults (SpawnerTime.ts/SpawnerProximity.ts), and implies 'project_path' is for file generation location. This adds substantial meaning not present in the bare schema.

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: 'Generate Spawner{Kind}.ts — instantiate @property prefab on a trigger.' It specifies the verb ('generate'), resource ('Spawner{Kind}.ts'), and distinguishes from siblings by focusing on spawner generation rather than adding components or assets. The detailed explanation of 'time' and 'proximity' variants further clarifies its unique functionality.

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 contexts through the explanation of 'time' and 'proximity' variants, but does not explicitly state when to use this tool versus alternatives. No sibling tools are mentioned for comparison, and there's no guidance on prerequisites or exclusions. The context is clear but lacks explicit usage directives.

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