Skip to main content
Glama

duplicate_frame

Create a copy of an existing animation frame in pixel art projects to reuse or modify content without redrawing.

Instructions

Duplicate a frame

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
frameIndexYesIndex of the frame to duplicate

Implementation Reference

  • The `duplicateFrame` method in `PiskelServer` implements the logic for the `duplicate_frame` MCP tool by duplicating the frame in all layers of the project and returning information about the new frame.
    private duplicateFrame(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`);
      }
    
      // Duplicate frame in all layers
      for (let i = 0; i < piskel.getLayerCount(); i++) {
        const layer = piskel.getLayerAt(i);
        if (layer) {
          const frame = layer.getFrameAt(frameIndex);
          if (frame) {
            layer.addFrame(frame.clone());
          }
        }
      }
    
      return {
        success: true,
        sourceFrameIndex: frameIndex,
        newFrameIndex: piskel.getFrameCount() - 1,
      };
    }
  • The `duplicate_frame` tool is registered in the MCP server definition within `PiskelServer.ts`.
    name: 'duplicate_frame',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('duplicate') but does not explain what duplication involves (e.g., whether it copies pixel data, layers, or metadata), potential side effects (e.g., reindexing of frames), or any constraints (e.g., permissions, rate limits). This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('Duplicate a frame') with no wasted words. It is front-loaded and appropriately sized for the tool's apparent simplicity, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It does not address what the tool returns (e.g., the new frame's index or data), behavioral details, or usage context. For a mutation tool with two parameters, this minimal description fails to provide sufficient context for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with parameters 'projectId' and 'frameIndex' clearly documented. The description does not add any meaning beyond the schema (e.g., it does not clarify what 'frameIndex' refers to or how duplication affects indices). Baseline score of 3 is appropriate as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Duplicate a frame' states the action (duplicate) and resource (frame), which provides basic purpose clarity. However, it lacks specificity about what duplication entails (e.g., copying content, metadata, or both) and does not distinguish it from sibling tools like 'add_frame' or 'remove_frame', making it vague rather than precise.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites (e.g., existing frames), exclusions, or comparisons to siblings like 'add_frame' (which might create a new frame from scratch) or 'remove_frame', leaving the agent without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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