Skip to main content
Glama

cocos_add_directional_light

Add a directional light source to a Cocos Creator scene to simulate sunlight or moonlight, with configurable color, intensity, and shadow settings for realistic lighting.

Instructions

Attach cc.DirectionalLight — sun/moon parallel light.

illuminance is in lux (default 65000 ≈ midday sun). shadow_pcf: 0=HARD, 1=SOFT, 2=SOFT_2X, 3=SOFT_4X. A scene typically has exactly one directional light.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
color_rNo
color_gNo
color_bNo
color_aNo
illuminanceNo
use_color_temperatureNo
color_temperatureNo
shadow_enabledNo
shadow_pcfNo
shadow_distanceNo
csm_levelNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It explains some behavioral aspects like default illuminance values and shadow PCF mapping, but doesn't cover important behavioral traits like whether this operation is destructive/reversible, permission requirements, rate limits, or what the output contains. The description adds value but leaves significant behavioral gaps.

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 perfectly concise with three focused sentences that each earn their place: first states the core purpose, second explains key parameter semantics, third provides usage context. No wasted words, front-loaded with the most important information, and well-structured for quick comprehension.

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 the tool's complexity (13 parameters, no annotations) but presence of an output schema, the description does well by covering purpose, key parameter semantics, and usage context. However, for a mutation tool with many parameters and no annotations, it could benefit from more behavioral context about what the tool actually does (creates/modifies/attaches) and potential side effects.

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?

With 0% schema description coverage and 13 parameters, the description compensates excellently by explaining the semantics of key parameters: 'illuminance' units (lux) with a real-world reference (65000 ≈ midday sun), and 'shadow_pcf' enumeration mapping (0=HARD, 1=SOFT, etc.). This adds crucial meaning beyond what the bare schema provides for the most important parameters.

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 specific action ('Attach cc.DirectionalLight') and resource ('sun/moon parallel light'), distinguishing it from sibling tools like 'cocos_add_sphere_light' or 'cocos_add_spot_light' by specifying it's for directional lighting. It provides concrete technical context about what type of light component is being added.

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 about when to use this tool ('A scene typically has exactly one directional light'), which helps the agent understand its appropriate application. However, it doesn't explicitly mention when NOT to use it or name specific alternatives among the many sibling tools, preventing a perfect score.

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