Skip to main content
Glama

draw_circle

Add circles or ellipses to pixel art projects by specifying bounding box coordinates and color, with options for outline or filled shapes.

Instructions

Draw a circle/ellipse (outline or filled)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject identifier
layerIndexNoLayer index (default: 0)
frameIndexNoFrame index (default: 0)
x0YesBounding box top-left X
y0YesBounding box top-left Y
x1YesBounding box bottom-right X
y1YesBounding box bottom-right Y
colorYesColor in hex format
filledNoWhether to fill the circle (default: false)
penSizeNoStroke width for outline (default: 1)

Implementation Reference

  • The drawCircleTool method in PiskelServer serves as the handler for the 'draw_circle' tool, delegating the logic to either drawFilledCircle or the imported drawCircle function.
    private drawCircleTool(
      projectId: string,
      layerIndex: number,
      frameIndex: number,
      x0: number,
      y0: number,
      x1: number,
      y1: number,
      color: string,
      filled: boolean,
      penSize: number
    ): object {
      const frame = this.getFrame(projectId, layerIndex, frameIndex);
      const count = filled
        ? drawFilledCircle(frame, x0, y0, x1, y1, color)
        : drawCircle(frame, x0, y0, x1, y1, color, penSize);
      return { success: true, pixelsDrawn: count };
  • The drawCircle function in src/tools/drawing.ts implements the actual pixel manipulation logic for drawing an outline circle.
    export function drawCircle(
      frame: Frame,
      x0: number,
      y0: number,
      x1: number,
      y1: number,
      color: number | string,
      penSize: number = 1
    ): number {
      const colorInt = typeof color === 'string' ? colorToInt(color) : color;
      const pixels = getCirclePixels(x0, y0, x1, y1, penSize);
    
      let count = 0;
      const drawnSet = new Set<string>();
    
      for (const [x, y] of pixels) {
        const key = `${x},${y}`;
        if (!drawnSet.has(key) && frame.containsPixel(x, y)) {
          drawnSet.add(key);
          frame.setPixel(x, y, colorInt);
          count++;
        }
  • The schema definition for 'draw_circle' in PiskelServer, specifying inputs such as coordinates, color, and optional filled/penSize properties.
      name: 'draw_circle',
      description: 'Draw a circle/ellipse (outline or filled)',
      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)',
          },
          x0: {
            type: 'number',
            description: 'Bounding box top-left X',
          },
          y0: {
            type: 'number',
            description: 'Bounding box top-left Y',
          },
          x1: {
            type: 'number',
            description: 'Bounding box bottom-right X',
          },
          y1: {
            type: 'number',
            description: 'Bounding box bottom-right Y',
          },
          color: {
            type: 'string',
            description: 'Color in hex format',
          },
          filled: {
            type: 'boolean',
            description: 'Whether to fill the circle (default: false)',
          },
          penSize: {
            type: 'number',
            description: 'Stroke width for outline (default: 1)',
          },
        },
        required: ['projectId', 'x0', 'y0', 'x1', 'y1', 'color'],
      },
    },
  • The tool execution routing in executeToolCall directs 'draw_circle' requests to the drawCircleTool handler.
    case 'draw_circle':
      return this.drawCircleTool(
        args.projectId as string,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'outline or filled' which hints at the filled parameter's effect, but doesn't describe what happens when drawing occurs (e.g., whether it overwrites existing pixels, requires specific permissions, has performance implications, or returns any confirmation). For a mutation tool with 10 parameters, 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?

The description is extremely concise - a single parenthetical phrase that efficiently communicates the core functionality. Every word earns its place by specifying both the shape type and the fill/outline options. No wasted words or redundant information.

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 drawing/mutation tool with 10 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (success/failure, the drawn object, nothing?), doesn't mention error conditions, and provides minimal behavioral context. The agent would struggle to use this effectively without trial and error.

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 parameters thoroughly. The description adds minimal value beyond the schema - it implies the shape type and fill behavior, but doesn't explain coordinate systems, color formats, or layer/frame context beyond what's in the parameter descriptions. 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 clearly states the action ('draw') and the object ('circle/ellipse'), including whether it's outline or filled. It distinguishes from siblings like draw_line and draw_rectangle by specifying the shape type. However, it doesn't explicitly mention the bounding box approach, which is a key differentiator from other drawing tools.

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 about when to use this tool versus alternatives. The description doesn't mention when to choose draw_circle over draw_pixel, draw_line, or draw_rectangle, nor does it specify prerequisites like needing an existing project or layer. The agent must infer usage from parameter names alone.

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