delete_entities
Remove one or more entities from the PlayCanvas Editor by specifying their unique IDs. Ensures the root entity remains intact to maintain scene structure.
Instructions
Delete one or more entities. The root entity cannot be deleted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Array of entity IDs to delete. The root entity cannot be deleted. |
Implementation Reference
- src/tools/entity.ts:70-72 (handler)The handler function for the 'delete_entities' tool. It receives the list of entity IDs and proxies the delete call to the WebSocket server (wss.call('entities:delete', ids)), which forwards it to the connected editor.({ ids }) => { return wss.call('entities:delete', ids); }
- src/tools/entity.ts:67-69 (schema)Input schema for the 'delete_entities' tool, defining 'ids' as a non-empty array of EntityIdSchema (UUID strings).{ ids: z.array(EntityIdSchema).nonempty().describe('Array of entity IDs to delete. The root entity cannot be deleted.') },
- src/tools/entity.ts:64-73 (registration)MCP tool registration for 'delete_entities', specifying name, description, input schema, and handler function.mcp.tool( 'delete_entities', 'Delete one or more entities. The root entity cannot be deleted.', { ids: z.array(EntityIdSchema).nonempty().describe('Array of entity IDs to delete. The root entity cannot be deleted.') }, ({ ids }) => { return wss.call('entities:delete', ids); } );
- src/tools/schema/common.ts:35-35 (schema)Base Zod schema for entity IDs (UUID strings), used in the input schema for 'delete_entities'.export const EntityIdSchema = z.string().uuid().describe('An entity ID.');
- src/server.ts:78-78 (registration)Invocation of the entity tools registration function, which includes the 'delete_entities' tool.registerEntity(mcp, wss);