Skip to main content
Glama
playcanvas

PlayCanvas Editor MCP Server

Official
by playcanvas

remove_components

Delete specific components from an entity in the PlayCanvas Editor MCP Server, streamlining entity management for real-time 3D web applications.

Instructions

Remove components from an entity

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentsYesArray of component names to remove from the entity.
idYesAn entity ID.

Implementation Reference

  • Handler function that executes the tool logic by calling wss.call to remove the specified components from the entity.
    ({ id, components }) => {
        return wss.call('entities:components:remove', id, components);
  • Input schema validation using Zod for the tool parameters: entity ID and non-empty array of component names.
    {
        id: EntityIdSchema,
        components: z.array(ComponentNameSchema).nonempty().describe('Array of component names to remove from the entity.')
  • Registration of the 'remove_components' tool with the MCP server, including name, description, input schema, and handler.
    mcp.tool(
        'remove_components',
        'Remove components from an entity',
        {
            id: EntityIdSchema,
            components: z.array(ComponentNameSchema).nonempty().describe('Array of component names to remove from the entity.')
        },
        ({ id, components }) => {
            return wss.call('entities:components:remove', id, components);
        }
    );
  • Zod enum schema defining valid component names, used in the remove_components tool input schema.
    export const ComponentNameSchema = z.enum([
        'anim',
        'animation',
        'audiolistener',
        'button',
        'camera',
        'collision',
        'element',
        'layoutchild',
        'layoutgroup',
        'light',
        'model',
        'particlesystem',
        'render',
        'rigidbody',
        'screen',
        'script',
        'scrollbar',
        'scrollview',
        'sound',
        'sprite'
    ]);

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