Skip to main content
Glama

draw_line

Draw a straight line between two pixel coordinates on an Aseprite sprite, with optional pixel-perfect or antialiased rendering for clean pixel art.

Instructions

Draw a straight line from (x1,y1) to (x2,y2).

Args: pixel_perfect: Remove L-shaped corner pixels for a clean 1px pixel-art line. antialias: Smooth (Xiaolin Wu) line with alpha blending, RGB sprites only; ignored on indexed/gray. Takes precedence over pixel_perfect.

Coordinates: (0, 0) is the top-left pixel. x grows right, y grows DOWN. A span given as position plus size covers x .. x + width - 1, so width is a count of pixels, not an offset to the far edge.

Centring differs between primitives, so check this when aligning two shapes:

  • draw_rectangle(x, width) spans x .. x+width-1, centred on x + (width-1)/2. An even width therefore centres on a half pixel.

  • draw_ellipse(center, radius) spans center-radius .. center+radius, which is always an ODD 2*radius+1 pixels wide and always centred on a whole pixel.

  • draw_ellipse_in_box(x, y, width, height) takes the same bounding box as draw_rectangle and fills it exactly, so it is the one to use for an even diameter, a disc centred on an even canvas, or a circle that has to line up with a rectangle.

  • draw_symmetric_pixels mirrors about the canvas, not about either of the above.

Writes falling outside the canvas are dropped rather than raising. Every drawing tool reports pixels_written, and pixels_clipped when anything was dropped, so compare those against what you asked for rather than trusting ok.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
x1Yes
x2Yes
y1Yes
y2Yes
colorYes
frameNoDefault: 1.
layerNo
filenameYes
antialiasNoDefault: false.
pixel_perfectNoDefault: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changedv0.10.0
    • addedInput schema / properties / antialias / description
      Added value: +"Default: false."
    • removedInput schema / properties / antialias / title
      Removed value: -"Antialias"
    • removedInput schema / properties / color / title
      Removed value: -"Color"
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • addedInput schema / properties / frame / description
      Added value: +"Default: 1."
    • removedInput schema / properties / frame / title
      Removed value: -"Frame"
    • removedInput schema / properties / layer / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / layer / default
      Removed value: -null
    • removedInput schema / properties / layer / title
      Removed value: -"Layer"
    • addedInput schema / properties / layer / type
      Added value: +"string"
    • addedInput schema / properties / pixel_perfect / description
      Added value: +"Default: false."
    • removedInput schema / properties / pixel_perfect / title
      Removed value: -"Pixel Perfect"
    • removedInput schema / properties / x1 / title
      Removed value: -"X1"
    • removedInput schema / properties / x2 / title
      Removed value: -"X2"
    • removedInput schema / properties / y1 / title
      Removed value: -"Y1"
    • removedInput schema / properties / y2 / title
      Removed value: -"Y2"
    • removedInput schema / title
      Removed value: -"draw_lineArguments"
  2. First observedv0.7.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only provide readOnlyHint=false and openWorldHint=false. The description adds substantial behavioral context: out-of-canvas writes are dropped rather than raising, and reports pixels_written/pixels_clipped so the agent should compare against expectations rather than trusting 'ok'. This is exactly the kind of non-obvious behavior annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action and args, then provides useful coordinate/centring reference material. The centring section is lengthy and somewhat tangential to drawing a line, but it is structured and earns its place for alignment work. Slightly verbose but well organized.

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

Completeness5/5

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

For a drawing primitive with no output schema and low schema coverage, the description covers coordinate conventions, mode interactions, clipping behavior, and sibling primitive distinctions. An agent has everything needed to call it correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 30%, so the description must compensate. It explains pixel_perfect and antialias semantics, and critically defines the coordinate system ((0,0) top-left, y grows down, span = x..x+width-1). It does not explain frame, layer, or color parameters, leaving some gaps, but adds meaningful value beyond the schema.

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

Purpose5/5

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

States a specific verb+resource ('Draw a straight line') with exact endpoint syntax '(x1,y1) to (x2,y2)'. Distinguishes itself from sibling primitives like draw_rectangle, draw_ellipse, and draw_polyline by naming them and clarifying their differing centring conventions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly explains the alternative modes (pixel_perfect vs antialias) and when antialias applies (RGB only, ignored on indexed/gray, takes precedence over pixel_perfect). Does not give an explicit when-to-use-this-tool-instead-of-siblings directive, but the centring comparisons guide the agent toward the right primitive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools