Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

reparent_entity

Change the parent of an entity in PlayCanvas Editor, allowing reorganization of 3D scene hierarchies while optionally preserving its transform for accurate positioning.

Instructions

Reparent an entity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAn entity ID.
indexNo
parentYes
preserveTransformNo

Implementation Reference

  • MCP tool registration for 'reparent_entity', defining the input schema and a handler that forwards the request to the websocket server via wss.call('entities:reparent', options). This is the primary implementation of the MCP tool.
    mcp.tool(
        'reparent_entity',
        'Reparent an entity',
        {
            id: EntityIdSchema,
            parent: EntityIdSchema,
            index: z.number().optional(),
            preserveTransform: z.boolean().optional()
        },
        (options) => {
            return wss.call('entities:reparent', options);
        }
    );
  • Core handler logic for reparenting entities using the PlayCanvas Editor API (api.entities.get and entity.reparent). Called by the MCP tool handler via websocket.
    wsc.method('entities:reparent', (options) => {
        const entity = api.entities.get(options.id);
        if (!entity) {
            return { error: 'Entity not found' };
        }
        const parent = api.entities.get(options.parent);
        if (!parent) {
            return { error: 'Parent entity not found' };
        }
        entity.reparent(parent, options.index, {
            preserveTransform: options.preserveTransform
        });
        log(`Reparented entity(${options.id}) to entity(${options.parent})`);
        return { data: entity.json() };
    });
  • Zod schema definition for EntityId used in the reparent_entity tool input (for both 'id' and 'parent' fields).
    export const EntityIdSchema = z.string().uuid().describe('An entity ID.');
  • Input schema for the reparent_entity tool, specifying parameters id, parent, index, and preserveTransform.
        {
            id: EntityIdSchema,
            parent: EntityIdSchema,
            index: z.number().optional(),
            preserveTransform: z.boolean().optional()
        },
        (options) => {
            return wss.call('entities:reparent', options);
        }
    );
Behavior2/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 but offers minimal insight. 'Reparent an entity' implies a mutation operation that changes an entity's parent, but it does not address critical behaviors like whether this requires specific permissions, if it's reversible, potential side effects on child entities, or error conditions. The description fails to compensate for the lack of annotations, leaving significant gaps in understanding the tool's behavior.

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 extremely concise with just three words, which is front-loaded and wastes no space. However, this brevity comes at the cost of under-specification, as it omits necessary details for a mutation tool with multiple parameters. While structurally efficient, it prioritizes conciseness over clarity.

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

Completeness1/5

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

Given the complexity of a mutation tool with 4 parameters, low schema coverage (25%), no annotations, and no output schema, the description is severely incomplete. It does not explain the operation's effects, return values, or error handling, making it inadequate for safe and effective use by an AI agent. The lack of contextual information renders the tool poorly defined.

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?

The schema description coverage is low at 25%, with only the 'id' parameter documented. The description does not add any semantic information about the parameters, such as explaining what 'reparent' means in terms of 'id' and 'parent', the purpose of 'index' or 'preserveTransform', or how they affect the operation. It fails to compensate for the poor schema coverage, leaving most parameters unexplained.

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

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Reparent an entity' is a tautology that merely restates the tool name without adding meaningful context. It specifies the verb ('reparent') and resource ('entity'), but fails to explain what reparenting entails or how it differs from sibling tools like 'modify_entities' or 'duplicate_entities'. This leaves the purpose vague and indistinguishable from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, such as needing existing entities or valid parent-child relationships, nor does it suggest when other tools like 'modify_entities' might be more appropriate. Without any usage context, the agent lacks direction for tool selection.

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

Related 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/playcanvas/editor-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server