Skip to main content
Glama

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
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexYesIndex of the layer to remove

Implementation Reference

  • 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 };
    }
  • 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'],
  • The tool dispatcher logic that calls removeLayer based on the tool name.
    case 'remove_layer':
      return this.removeLayer(

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/yafeiaa/piskel-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server