Skip to main content
Glama

cocos_assert_scene_state

Validate scene and prefab states using regression-style assertions to detect changes in properties, components, and node structures during automated testing.

Instructions

Declarative expectations against a scene/prefab — regression- test style.

Each entry in assertions:

{"path": "", "op": "", "value": }

with optional root-finder shortcuts:

{"find_node_by_name": "Player", # find first cc.Node _name "path": "_lpos.x", "op": "gt", "value": 0}

{"find_component": {"type": "cc.Sprite", "on_node_named": "Enemy"}, "path": "_color.r", "op": "eq", "value": 255}

Ops: eq / ne / gt / ge / lt / le / in / not_in / contains / match / is_null / not_null / type_is / exists / not_exists

Path syntax: _children[0].__id__ / 15._lpos.x. First dotted segment as int + root is list → list index. [N] always list index. Missing path → LookupError surfaces as a failed assertion (or passes if op=not_exists).

Runs EVERY assertion even if earlier ones fail — regression checks want a full report, not a first-failure bail.

Returns {ok, scene_path, total, passed_count, failed_count, passed: [...], failed: [...]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
assertionsYes
Behavior5/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 excels by detailing: the execution model ('Runs EVERY assertion even if earlier ones fail'), error handling ('LookupError surfaces as a failed assertion'), return format ('Returns {ok, scene_path, total, passed_count, failed_count, passed: [...], failed: [...]}'), and operational constraints. This provides comprehensive behavioral context beyond basic parameter documentation.

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 appropriately sized and front-loaded with the core purpose. While dense with technical details, every sentence serves a purpose - explaining parameters, operations, syntax, and behavior. It could be slightly more structured with clearer section breaks, but the information is well-organized and avoids redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (testing/validation with detailed assertion logic), no annotations, 0% schema coverage, and no output schema, the description provides complete context. It covers purpose, usage, detailed parameter semantics, behavioral traits, and return format. This is comprehensive enough for an agent to understand and correctly invoke the tool despite the lack of structured metadata.

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 for the 2 parameters, the description fully compensates by explaining both parameters in detail. It documents 'scene_path' contextually and provides extensive documentation for 'assertions' including structure examples, path syntax, operations, and optional root-finder shortcuts. This adds significant semantic meaning beyond 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: 'Declarative expectations against a scene/prefab — regression-test style.' It specifies the verb ('assertions') and resource ('scene/prefab'), and distinguishes it from all sibling tools which are primarily creation/editing tools rather than testing/validation tools.

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 ('regression-test style'), but doesn't explicitly mention when not to use it or name specific alternative tools. It implies usage for testing scene/prefab states, which is helpful but lacks explicit exclusions or comparisons to other validation tools.

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