Skip to main content
Glama

cocos_add_relative_joint2d

Attach a relative joint in Cocos Creator to maintain position and angle between physics bodies, enabling follow-target behavior for game objects.

Instructions

Attach cc.RelativeJoint2D — keeps relative position+angle ('attach to' effect).

Also covers the follow-target use case that the old cocos_add_motor_joint2d tried to solve; cc.MotorJoint2D does not exist in Cocos 3.8.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scene_pathYes
node_idYes
connected_body_idNo
max_forceNo
max_torqueNo
correction_factorNo
auto_calc_offsetNo
linear_offset_xNo
linear_offset_yNo
angular_offsetNo
collide_connectedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/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 describes the joint's effect ('keeps relative position+angle') and mentions it replaces an old motor joint, but doesn't disclose critical behavioral traits like whether this is a destructive operation, what permissions are needed, rate limits, error conditions, or what happens when parameters are invalid. The description adds some context but leaves significant gaps.

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 concise with two sentences that each serve a purpose: the first explains what the tool does, and the second provides historical context about replacing an old tool. There's no wasted text, though it could be slightly more structured for clarity.

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

Completeness2/5

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

Given the tool's complexity (11 parameters, physics/joint functionality), no annotations, and 0% schema description coverage, the description is insufficiently complete. While an output schema exists, the description doesn't explain the joint's behavior in enough detail for an agent to use it effectively, especially given the many parameters with technical meanings that aren't explained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 11 parameters and 0% schema description coverage, the description provides no parameter semantics whatsoever. It doesn't explain what any of the parameters mean, how they affect the joint behavior, or provide usage examples. The schema has descriptive titles but the description adds zero value beyond what's already in the structured schema fields.

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: 'Attach cc.RelativeJoint2D' with the specific behavior of 'keeps relative position+angle ('attach to' effect)'. It distinguishes from sibling tools by mentioning the deprecated 'cocos_add_motor_joint2d' and explaining that cc.MotorJoint2D doesn't exist in Cocos 3.8, though it doesn't explicitly differentiate from other joint tools in the sibling list.

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 provides implied usage guidance by mentioning it 'covers the follow-target use case that the old cocos_add_motor_joint2d tried to solve', suggesting when this tool might be appropriate. However, it doesn't explicitly state when to use this versus other joint tools (like cocos_add_distance_joint2d or cocos_add_fixed_joint_2d) or provide clear when-not-to-use scenarios.

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