Skip to main content
Glama

cocos_set_fog

Configure volumetric fog in Cocos Creator scenes by setting fog type, color, density, and range parameters to create atmospheric effects.

Instructions

Configure volumetric fog on the scene's cc.FogInfo.

Fourth scene-global alongside ambient/skybox/shadows. Lazy-creates a cc.FogInfo + links it from cc.SceneGlobals if the scene doesn't have one yet (scenes built before this tool existed won't).

fog_type: 0=LINEAR (use start+end), 1=EXP (density), 2=EXP_SQUARED, 3=LAYERED (top+range). Atmospheric settings are inter-dependent — LINEAR ignores density, EXP/EXP_SQUARED ignore start/end.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
enabledNo
fog_typeNo
color_rNo
color_gNo
color_bNo
color_aNo
densityNo
startNo
endNo
attenNo
topNo
fog_rangeNo
accurateNo
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 that the tool lazy-creates a cc.FogInfo and links it if missing, which is useful behavioral context. It also mentions atmospheric settings are inter-dependent, hinting at constraints. However, it doesn't cover critical aspects like whether this is a read/write operation, error handling, or side effects beyond creation, leaving gaps for a mutation 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 appropriately sized and front-loaded: the first sentence states the purpose, followed by context and parameter details. Every sentence adds value—no fluff or repetition. It's efficiently structured for quick understanding.

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 the tool's complexity (14 parameters, mutation operation) and lack of annotations/output schema, the description is partially complete. It explains key parameters and behavioral traits but misses details on return values, error cases, and full parameter semantics. It's adequate for basic use but has clear gaps for advanced scenarios.

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 adds significant meaning by explaining fog_type values (0=LINEAR, etc.) and their dependencies (e.g., LINEAR ignores density). This clarifies parameter interactions beyond the bare schema. However, it doesn't cover all 14 parameters (e.g., color components, atten, accurate), so it's not fully comprehensive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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: 'Configure volumetric fog on the scene's cc.FogInfo.' It specifies the verb ('configure') and resource ('volumetric fog'), and distinguishes it from siblings by mentioning it's the 'fourth scene-global alongside ambient/skybox/shadows.' However, it doesn't explicitly differentiate from all sibling tools, just contextualizes within a category.

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 by stating it's for configuring fog and lazy-creates a cc.FogInfo if missing, which suggests when to use it (when fog needs setup). It mentions atmospheric settings are inter-dependent, hinting at parameter relationships. However, it lacks explicit guidance on when to use this vs. alternatives (e.g., other fog-related tools if any) or prerequisites, leaving some ambiguity.

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