Skip to main content
Glama

remove_frame

Delete a specific animation frame from all layers in a pixel art project to edit sequences and manage animation timing.

Instructions

Remove a frame from all layers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
frameIndexYesIndex of the frame to remove

Implementation Reference

  • Handler method that implements the "remove_frame" tool logic.
    private removeFrame(projectId: string, frameIndex: number): object {
      const piskel = this.getProject(projectId);
    
      if (frameIndex < 0 || frameIndex >= piskel.getFrameCount()) {
        throw new Error(`Frame index ${frameIndex} out of range`);
      }
    
      // Remove frame from all layers
      for (let i = 0; i < piskel.getLayerCount(); i++) {
        const layer = piskel.getLayerAt(i);
        if (layer) {
          layer.removeFrameAt(frameIndex);
        }
      }
    
      return { success: true, frameIndex };
    }
  • MCP tool registration and input schema definition for "remove_frame".
      name: 'remove_frame',
      description: 'Remove a frame from all layers',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'Project identifier',
          },
          frameIndex: {
            type: 'number',
            description: 'Index of the frame to remove',
          },
        },
        required: ['projectId', 'frameIndex'],
      },
    },
  • Switch case in the tool execution handler that routes to the removeFrame implementation.
    case 'remove_frame':
      return this.removeFrame(
        args.projectId as string,
        args.frameIndex as number
      );

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