Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

duplicate_entities

Duplicate one or more entities in PlayCanvas Editor by providing their UUIDs. Enables efficient replication of 3D web application components.

Instructions

Duplicate one or more entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYesArray of entity IDs to duplicate. The root entity cannot be duplicated.
renameNo

Implementation Reference

  • MCP tool registration for 'duplicate_entities', including input schema (ids: array of EntityId, optional rename boolean) and handler that calls WSS 'entities:duplicate'.
    mcp.tool(
        'duplicate_entities',
        'Duplicate one or more entities',
        {
            ids: z.array(EntityIdSchema).nonempty().describe('Array of entity IDs to duplicate. The root entity cannot be duplicated.'),
            rename: z.boolean().optional()
        },
        ({ ids, rename }) => {
            return wss.call('entities:duplicate', ids, { rename });
        }
    );
  • WebSocket server handler implementing the duplication logic using PlayCanvas Editor API: fetches entities by IDs, calls api.entities.duplicate, returns JSON.
    wsc.method('entities:duplicate', async (ids, options = {}) => {
        const entities = ids.map((id) => api.entities.get(id));
        if (!entities.length) {
            return { error: 'Entities not found' };
        }
        const res = await api.entities.duplicate(entities, options);
        log(`Duplicated entities: ${res.map((entity) => entity.get('resource_id')).join(', ')}`);
        return { data: res.map((entity) => entity.json()) };
    });
  • src/server.ts:78-78 (registration)
    Top-level call to register all entity tools, including 'duplicate_entities', on the MCP server.
    registerEntity(mcp, wss);
  • Input schema for duplicate_entities tool: ids (non-empty array of EntityIdSchema), optional rename boolean.
    {
        ids: z.array(EntityIdSchema).nonempty().describe('Array of entity IDs to duplicate. The root entity cannot be duplicated.'),
        rename: z.boolean().optional()
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Duplicate' implies a write operation that creates copies, but the description doesn't specify permissions required, whether duplicates inherit properties, if there are rate limits, or what the output looks like. This leaves significant 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 a single, efficient sentence with zero wasted words. It's front-loaded and appropriately sized for its purpose, making it easy to parse quickly.

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?

For a mutation tool with no annotations, no output schema, and incomplete parameter documentation, the description is inadequate. It doesn't explain behavioral aspects like what 'duplicate' entails operationally, potential side effects, or return values, leaving the agent with insufficient context to use it effectively.

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

Parameters3/5

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

Schema description coverage is 50%, with the 'ids' parameter well-documented but 'rename' lacking a description. The tool description adds no parameter semantics beyond the schema, failing to compensate for the coverage gap. Since schema coverage is moderate, the baseline score of 3 reflects minimal added value.

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

Purpose3/5

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

The description 'Duplicate one or more entities' clearly states the verb (duplicate) and resource (entities), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'create_entities' or 'modify_entities', leaving ambiguity about when duplication is preferred over creation or modification.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like 'create_entities' and 'modify_entities' available, the description lacks context about prerequisites (e.g., needing existing entities to duplicate) or scenarios where duplication is appropriate over creation from scratch.

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