Skip to main content
Glama

draw_rectangle

Draw a filled or 1px outlined rectangle on an Aseprite canvas by giving position, width, height, and color; width counts pixels, not an offset.

Instructions

Draw a rectangle. filled=False draws a 1px outline, True fills it.

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
xYes
yYes
colorYes
frameNoDefault: 1.
layerNo
widthYes
filledNoDefault: false.
heightYes
filenameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.10.0
    • removedInput schema / properties / color / title
      Removed value: -"Color"
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • addedInput schema / properties / filled / description
      Added value: +"Default: false."
    • removedInput schema / properties / filled / title
      Removed value: -"Filled"
    • addedInput schema / properties / frame / description
      Added value: +"Default: 1."
    • removedInput schema / properties / frame / title
      Removed value: -"Frame"
    • removedInput schema / properties / height / title
      Removed value: -"Height"
    • 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"
    • removedInput schema / properties / width / title
      Removed value: -"Width"
    • removedInput schema / properties / x / title
      Removed value: -"X"
    • removedInput schema / properties / y / title
      Removed value: -"Y"
    • removedInput schema / title
      Removed value: -"draw_rectangleArguments"
  2. First observedv0.7.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only give readOnlyHint=false and openWorldHint=false, so the description carries the behavioural load and does so: out-of-canvas writes are dropped rather than raising, and the tool returns pixels_written/pixels_clipped which should be compared against intent rather than trusting 'ok'. That is exactly the kind of trait an agent needs and cannot get from structured fields.

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-loaded with the core behaviour, then the coordinate/centring detail. Every bullet carries real information an agent needs for alignment, though the centring section is long enough that a shorter phrasing could convey the same rule.

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

Completeness4/5

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

For a mutation tool with no output schema, the description closes the biggest gaps by naming the returned counters (pixels_written, pixels_clipped) and the clipping policy. It is not fully complete because four of nine parameters (filename, color, layer, frame) get no explanation anywhere.

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 22%, so the description must compensate, and it does for the geometric core: it defines the origin, growth direction, the x..x+width-1 span rule, and the filled flag. However, filename, color, layer and frame are left entirely undocumented in both schema and prose, so the compensation is substantial but incomplete.

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 and resource ('Draw a rectangle') and immediately pins down the filled flag's meaning. It also explicitly distinguishes itself from near-siblings (draw_ellipse, draw_ellipse_in_box, draw_symmetric_pixels), so an agent can route correctly without opening schemas.

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

Usage Guidelines5/5

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

Gives explicit when-to-use-which guidance: pick draw_ellipse_in_box for even diameters, a disc centred on an even canvas, or a circle that must line up with a rectangle, and notes draw_symmetric_pixels mirrors about the canvas. It also states the alignment/centring condition that governs the choice.

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