Skip to main content
Glama

erase_pixel

Remove pixels by setting them to transparent in pixel art projects. Use this tool to erase specific areas on animation frames or layers for precise editing.

Instructions

Erase pixels (set to transparent)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
xYesX coordinate
yYesY coordinate
penSizeNoEraser size (default: 1)

Implementation Reference

  • The PiskelServer method that acts as the handler for the erase_pixel tool.
    private erasePixelTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x: number,
      y: number,
      penSize: number
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const count = erasePixel(frame, x, y, penSize);
      return { success: true, pixelsErased: count };
    }
  • The core logic implementation for erasing pixels on a frame.
    export function erasePixel(
      frame: Frame,
      x: number,
      y: number,
      penSize: number = 1
    ): number {
      let count = 0;
    
      if (penSize === 1) {
        if (frame.containsPixel(x, y)) {
          frame.setPixel(x, y, 0); // Transparent
          count = 1;
        }
      } else {
        const pixels = resizePixel(x, y, penSize);
        for (const [px, py] of pixels) {
          if (frame.containsPixel(px, py)) {
            frame.setPixel(px, py, 0);
            count++;
  • The registration of the erase_pixel tool in the server schema.
    name: 'erase_pixel',
    description: 'Erase pixels (set to transparent)',
    inputSchema: {
      type: 'object',
      properties: {
        projectId: {
          type: 'string',
          description: 'Project identifier',
        },
        layerIndex: {
          type: 'number',
          description: 'Layer index (default: 0)',
        },
        frameIndex: {
          type: 'number',
          description: 'Frame index (default: 0)',
        },
        x: {
          type: 'number',
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic effect ('set to transparent'). It doesn't mention permissions needed, whether the operation is destructive (implied by 'erase'), rate limits, or what happens on success/failure. For a mutation tool, this is inadequate.

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?

Extremely concise with a single, clear sentence that front-loads the core action. Every word earns its place with no wasted text.

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?

For a mutation tool with 6 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return value, error conditions, or behavioral nuances like whether erasing is undoable or affects multiple frames/layers.

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 parameters are well-documented in the schema. The description adds no additional parameter context beyond implying 'penSize' relates to eraser size, which is already in the schema. Baseline 3 is appropriate as the 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 ('Erase pixels') and the effect ('set to transparent'), which is specific and distinguishes it from drawing tools. However, it doesn't explicitly differentiate from 'clear_frame' or 'fill_area' which might also affect transparency.

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 like 'clear_frame' (which clears an entire frame) or 'fill_area' (which might fill with transparency). The description only states what it does, not when it's appropriate.

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