Skip to main content
Glama

draw_ellipse_in_box

Draw an ellipse that exactly fills a bounding box, ideal for even-diameter discs, circles aligned with rectangles, or centered on even canvases.

Instructions

Draw an ellipse that fills the given bounding box exactly.

Takes the same box as draw_rectangle, so the two share a centre and an extent: this is how to draw a disc centred on an even canvas, or a circle that lines up with a rectangle. draw_ellipse takes a centre and radii instead, which can only ever be an odd 2*radius+1 across.

An even side is drawn the way it is drawn by hand: the odd ellipse one pixel smaller, with its middle row or column repeated. Give an odd width and height and the result is pixel for pixel what draw_ellipse produces for the same shape, because both use the same geometry.

filled=False draws a 1px outline. antialias smooths a filled ellipse with sub-pixel coverage (RGB sprites only; ignored otherwise).

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
antialiasNoDefault: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only state readOnlyHint=false and openWorldHint=false. The description adds substantial behavioral detail beyond that: out-of-canvas writes are dropped rather than raising, results are reported via pixels_written/pixels_clipped that should be checked instead of trusting ok, and antialias applies only to filled RGB sprites. This is rich context the annotations do not carry.

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 purpose, then structured into geometry, centring comparison, and clipping notes. It is long, but nearly every sentence carries distinct information (odd/even parity, layout alignment, clip reporting); the bulleted centring section is the only part that could be tightened.

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 10-parameter mutation tool with no output schema, it covers the critical drawing semantics, coordinate convention, and return-field behavior. It leaves color format and the frame/layer parameters unexplained, so it is strong but not fully complete.

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?

With only 30% schema coverage, the description must compensate and largely does: it defines the box semantics of x/y/width/height ('x .. x + width - 1, so width is a count of pixels, not an offset'), explains filled=False as a 1px outline, and clarifies antialias behavior. Gaps remain for color, layer, and frame, which are undocumented in both schema and description.

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?

Opens with a precise verb+resource+scope: draw an ellipse that fills the given bounding box exactly. It explicitly distinguishes itself from draw_ellipse (centre+radii, odd sizes), draw_rectangle (shares the box), and draw_symmetric_pixels, so an agent can pick 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?

States explicitly when to use this tool ('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') and pins the comparison against named alternatives, including the odd-vs-even size distinction versus draw_ellipse.

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