Skip to main content
Glama

draw_pixels

Draw multiple pixels simultaneously in pixel art projects to create shapes, patterns, or fill areas efficiently using specified coordinates and colors.

Instructions

Draw multiple pixels at once

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
pixelsYesArray of pixel coordinates
colorYesColor in hex format

Implementation Reference

  • The server-side handler for the 'draw_pixels' tool, which fetches the correct frame and calls the core `drawPixels` function.
    private drawPixelsTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      pixels: Array<{ x: number; y: number }>,
      color: string
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const count = drawPixels(frame, pixels, color);
      return { success: true, pixelsDrawn: count };
    }
  • The core logic for drawing pixels on a frame.
    export function drawPixels(
      frame: Frame,
      pixels: Array<{ x: number; y: number }>,
      color: number | string
    ): number {
      let count = 0;
      const colorInt = typeof color === 'string' ? colorToInt(color) : color;
    
      for (const { x, y } of pixels) {
        if (frame.containsPixel(x, y)) {
          frame.setPixel(x, y, colorInt);
          count++;
        }
      }
    
      return count;
    }
  • Registration of the 'draw_pixels' tool within the server's tool definitions.
    name: 'draw_pixels',
    description: 'Draw multiple pixels at once',
    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)',
        },
        pixels: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Draw' implies a write/mutation operation, but the description doesn't specify whether this requires authentication, what happens if pixels overlap existing content, whether the operation is reversible, or any rate limits. It lacks essential context for safe and effective use.

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 with zero wasted words. It's front-loaded with the core action and immediately clarifies the batch nature of the operation. Every part of the sentence earns its place by distinguishing from 'draw_pixel'.

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 complexity of a mutation tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'drawing' entails (e.g., setting pixel colors), the expected return value, error conditions, or how it interacts with sibling tools. For a tool that modifies data, this leaves critical gaps in understanding.

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%, with all parameters documented in the schema itself. The description adds no additional meaning beyond implying 'multiple pixels' relates to the 'pixels' array parameter. Since the schema already fully describes parameters, the baseline score of 3 is appropriate—the description doesn't enhance parameter understanding but doesn't detract either.

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 ('draw') and resource ('pixels') with the qualifier 'multiple...at once', which distinguishes it from the sibling tool 'draw_pixel'. However, it doesn't specify what system or context these pixels belong to (e.g., a graphics project, canvas, or animation), leaving some ambiguity about the exact resource being modified.

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?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'draw_pixel', 'draw_circle', 'draw_line', 'draw_rectangle', and 'fill_area', there's no indication of when batch pixel drawing is preferred over single-pixel operations or other drawing primitives, nor any mention of prerequisites or constraints.

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