remove_layer
Delete a specific layer from a pixel art project to simplify compositions or remove unwanted elements. Use project ID and layer index to target the exact layer for removal.
Instructions
Remove a layer from the project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project identifier | |
| layerIndex | Yes | Index of the layer to remove |
Implementation Reference
- src/server/PiskelServer.ts:977-986 (handler)The handler method that executes the logic to remove a layer from the project.
private removeLayer(projectId: string, layerIndex: number): object { const piskel = this.getProject(projectId); const layer = piskel.getLayerAt(layerIndex); if (!layer) { throw new Error(`Layer ${layerIndex} not found`); } piskel.removeLayer(layer); return { success: true, layerIndex }; } - src/server/PiskelServer.ts:164-178 (schema)The MCP tool definition and input schema for the remove_layer tool.
name: 'remove_layer', description: 'Remove a layer from the project', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project identifier', }, layerIndex: { type: 'number', description: 'Index of the layer to remove', }, }, required: ['projectId', 'layerIndex'], - src/server/PiskelServer.ts:729-730 (registration)The tool dispatcher logic that calls removeLayer based on the tool name.
case 'remove_layer': return this.removeLayer(