Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

create_entities

Create one or more entities in the PlayCanvas Editor, enabling the definition of properties like name, position, rotation, scale, tags, and components, as well as parent-child hierarchies for 3D application development.

Instructions

Create one or more entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entitiesYesArray of entity hierarchies to create.

Implementation Reference

  • Registration of the MCP tool 'create_entities'. Includes inline input schema validation using Zod and a handler function that proxies the call to the WebSocket server via wss.call('entities:create', entities). This constitutes the full tool implementation in the MCP context.
        'create_entities',
        'Create one or more entities',
        {
            entities: z.array(z.object({
                entity: EntitySchema,
                parent: EntityIdSchema.optional().describe('The parent entity to create the entity under. If not provided, the root entity will be used.')
            })).nonempty().describe('Array of entity hierarchies to create.')
        },
        ({ entities }) => {
            return wss.call('entities:create', entities);
        }
    );
  • The handler function for the 'create_entities' tool, which receives the validated 'entities' input and forwards it to the backend via wss.call('entities:create', entities).
    ({ entities }) => {
        return wss.call('entities:create', entities);
    }
  • Input schema for 'create_entities' tool using Zod: non-empty array of objects with 'entity' (EntitySchema) and optional 'parent' (EntityIdSchema).
    entities: z.array(z.object({
        entity: EntitySchema,
        parent: EntityIdSchema.optional().describe('The parent entity to create the entity under. If not provided, the root entity will be used.')
    })).nonempty().describe('Array of entity hierarchies to create.')

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