Skip to main content
Glama

draw_rect

Draw rectangle outlines with adjustable thickness or filled rectangles onto a chosen sprite layer and frame, clipped to the canvas for pixel-art editing.

Instructions

Draw a rectangle outline (growing inwards with thickness) or a filled rectangle.

Clipped to the canvas.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "rect": "<rect>",
      "color": "<color>"
    },
    "name": "draw_rect"
  }
}

Input Schema

NameRequiredDescriptionDefault
fillNoFill the shape; false draws the outline only
pathYesSprite file. Relative paths resolve against the server root.
rectYesRectangle in canvas pixels
blendNofalse: pixels get exactly this colour (transparent erases, except on a background layer, which ignores alpha); true: the colour is alpha-blended over what is there
colorYes'#RRGGBB', '#RRGGBBAA' or 'transparent'
frameNo1-based frame number
layerNoLayer name or 'group/child' path; empty = the bottom-most normal layer
thicknessNoOutline width inside the rect; ignored with fill
create_celNoAdd an empty cel when the layer has none in that frame

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden, and it does disclose two useful traits beyond the schema: thickness grows inward from the rect edge, and drawing is clipped to the canvas. It does not say this is a mutating write to a file on disk, whether prior pixels are overwritten, or how the layer/cel defaults behave when the target layer is empty.

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?

Two short sentences, front-loaded with the primary action and the mode split, then the clipping constraint. Nothing is padded or repeated.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the schema documents the parameters richly. Still, for a 9-parameter mutating drawing tool with zero annotations, the description says nothing about persistence, overwrite semantics, or failure conditions, leaving meaningful gaps.

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 coverage is 100%, so all nine parameters including fill, thickness, blend, layer and create_cel are already documented in the schema, which sets the baseline at 3. The description's only added semantic, inward-growing thickness, largely restates the schema's 'Outline width inside the rect', so it adds little.

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?

States a concrete verb+resource ('Draw a rectangle') and immediately splits the two modes (outline vs filled), which is enough to distinguish it from draw_ellipse, draw_line, draw_polygon, etc. by shape alone. It never names a sibling, so it lands at 4 rather than 5.

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

Usage Guidelines3/5

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

Usage is only implied: you infer you should pick this tool when the shape is an axis-aligned rectangle, and the fill flag tells you which variant. There is no explicit when-to-use vs. alternatives (e.g. draw_pixels or draw_polygon for non-rectangular regions) and no stated prerequisites such as the sprite needing to exist.

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