Skip to main content
Glama

add_frame

Add a new animation frame to a pixel art layer in Piskel projects to create or extend animations.

Instructions

Add a new frame to a layer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoIndex of the layer (default: 0)

Implementation Reference

  • The implementation of the `add_frame` tool handler. It adds a new frame to all layers of the specified Piskel project.
    private addFrame(projectId: string, _layerIndex: number): object {
      const piskel = this.getProject(projectId);
    
      // Add frame to all layers
      for (let i = 0; i < piskel.getLayerCount(); i++) {
        const layer = piskel.getLayerAt(i);
        if (layer) {
          layer.addFrame(new Frame(piskel.getWidth(), piskel.getHeight()));
        }
      }
    
      return {
        success: true,
        frameIndex: piskel.getFrameCount() - 1,
      };
    }

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