Skip to main content
Glama

cocos_create_physics_material

Create physics material assets for Cocos Creator colliders with customizable friction and bounce properties to define object interactions in games.

Instructions

Create a cc.PhysicsMaterial (.pmat) asset. Returns {path, rel_path, uuid}.

Bind to a collider via cocos_set_uuid_property(collider_id, "_material", <uuid>).

Defaults match engine: friction=0.6, restitution=0 (no bounce). For bouncy materials set restitution 0.3-0.9; for ice set friction 0.02.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_pathYes
material_nameYes
frictionNo
rolling_frictionNo
spinning_frictionNo
restitutionNo
rel_dirNo
Behavior4/5

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

With no annotations provided, the description carries full burden and does well. It discloses the return format ({path, rel_path, uuid}), explains how to bind the material to a collider, provides default values that match the engine, and gives practical usage ranges for restitution and friction. It doesn't mention error conditions or performance implications, but covers the essential behavioral aspects.

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 efficiently structured with three focused sentences: creation purpose, binding instructions, and parameter guidance. Each sentence adds clear value without redundancy. The code snippet is appropriately brief and directly relevant to tool usage.

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 creation tool with no annotations and no output schema, the description provides good coverage of the tool's purpose, usage, and key parameters. It explains the return format and how to use the created asset. The main gap is incomplete parameter coverage (missing rolling_friction, spinning_friction, rel_dir), but overall it's quite helpful for understanding this tool's role.

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?

With 0% schema description coverage for 7 parameters, the description compensates well. It explains the meaning and typical usage of friction and restitution parameters with specific examples (0.6 default, 0.02 for ice, 0.3-0.9 for bouncy materials). However, it doesn't cover other parameters like rolling_friction, spinning_friction, or rel_dir, leaving some gaps in parameter understanding.

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 verb 'Create' and the resource 'cc.PhysicsMaterial (.pmat) asset', specifying it's a physics material asset. It distinguishes from sibling tools by focusing on physics material creation rather than other asset types like animations, scripts, or nodes.

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 on when to use this tool: to create physics materials with specific friction and restitution properties. It gives examples like 'for bouncy materials' and 'for ice', but doesn't explicitly state when NOT to use it or name alternative tools for similar purposes.

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