Skip to main content
Glama

get_frame_data

Extract pixel data from animation frames as 2D arrays for analysis, manipulation, or export in pixel art projects.

Instructions

Get all pixel data from a frame as a 2D array

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)

Implementation Reference

  • The implementation of the 'get_frame_data' tool logic, which retrieves pixels from a specific frame and converts them into a 2D array of color strings.
    private getFrameDataTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number
    ): object {
      const piskel = this.getProject(projectId);
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const width = piskel.getWidth();
      const height = piskel.getHeight();
      const pixels = frame.getPixels();
    
      const data: string[][] = [];
      for (let y = 0; y < height; y++) {
        const row: string[] = [];
        for (let x = 0; x < width; x++) {
          const color = pixels[y * width + x];
          row.push(color === 0 ? 'transparent' : intToHex(color));
        }
        data.push(row);
      }
    
      return { width, height, data };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves data ('Get'), implying a read-only operation, but doesn't disclose behavioral traits like whether it requires specific permissions, has rate limits, or what happens with invalid inputs. For a tool with zero annotation coverage, this is a significant gap in transparency.

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 that front-loads the core purpose ('Get all pixel data from a frame as a 2D array'). It has zero waste, with every word contributing directly to understanding the tool's function.

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

Completeness3/5

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

Given no annotations and no output schema, the description is minimally adequate. It explains what the tool does but lacks details on return format (e.g., array structure), error handling, or prerequisites. For a data retrieval tool with three parameters, it should provide more context to be fully complete.

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?

Schema description coverage is 100%, so the schema already documents all three parameters (projectId, layerIndex, frameIndex) with descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining the 2D array structure or default values. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('pixel data from a frame'), specifying it returns a 2D array. It distinguishes from siblings like get_pixel (single pixel) and get_project_info (metadata), but doesn't explicitly contrast them. The purpose is specific but lacks explicit sibling differentiation.

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 on when to use this tool versus alternatives is provided. It doesn't mention when to choose get_frame_data over get_pixel for single pixels or other data retrieval tools. The description implies usage for bulk pixel data but offers no explicit context or exclusions.

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