Skip to main content
Glama

get_pixel

Retrieve the color value of a specific pixel from a pixel art project by specifying coordinates, project ID, and optional layer and frame indices.

Instructions

Get the color of a pixel

Input Schema

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

Implementation Reference

  • The handler function for the get_pixel tool. It retrieves the frame and calls its getPixel method, then formats the result.
    private getPixelTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x: number,
      y: number
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const color = frame.getPixel(x, y);
    
      if (color === null) {
        return {
          x,
          y,
          color: 'out_of_bounds',
          colorInt: null,
        };
      }
    
      return {
        x,
        y,
        color: color === 0 ? 'transparent' : intToHex(color),
        colorInt: color,
      };
    }
    
    private getFrameDataTool(
  • The schema definition for the get_pixel tool registration.
    {
      name: 'get_pixel',
      description: 'Get the color of a pixel',
      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: {
  • The low-level helper function on the Frame class that retrieves the pixel value from the underlying pixel array.
    getPixel(x: number, y: number): number | null {
      if (!this.containsPixel(x, y)) {
        return null;
      }
      return this.pixels[y * this.width + x];
    }
Behavior2/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. While 'Get' implies a read-only operation, it doesn't specify permissions, rate limits, or what happens with invalid coordinates. The description lacks details on return format (e.g., color representation) or error handling.

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 waste. It's front-loaded and appropriately sized for a simple tool, making it easy to parse quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'color' means (e.g., RGB values, hex code), potential errors, or how it interacts with layers/frames. For a tool with 5 parameters and no structured output, more context is needed.

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 fully documents all parameters. The description adds no additional meaning beyond implying coordinates (x, y) are used to locate the pixel, which is already clear from the schema. Baseline 3 is appropriate when 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 'Get the color of a pixel' clearly states the action (get) and resource (color of a pixel), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_frame_data' or 'get_project_info', which also retrieve information but about different resources.

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. It doesn't mention prerequisites (e.g., needing a project), exclusions, or comparisons to similar tools like 'get_frame_data' for broader data retrieval.

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