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
| Name | Required | Description | Default |
|---|---|---|---|
| components | Yes | Array of component names to remove from the entity. | |
| id | Yes | An entity ID. |
Implementation Reference
- src/tools/entity.ts:103-104 (handler)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);
- src/tools/entity.ts:99-101 (schema)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.')
- src/tools/entity.ts:96-106 (registration)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); } );
- src/tools/schema/entity.ts:281-302 (schema)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' ]);