Skip to main content
Glama

add_outline

Draw a pixel outline around artwork already on a layer, with optional light-weighted thickness for sticker-style keylines or rim lights.

Instructions

Add a pixel outline around the artwork on a layer, optionally weighted by light.

The outline is drawn around the art **already on the layer given, onto that same
layer**. It does not outline other layers, so it cannot draw a keyline onto a fresh
empty layer of its own; a layer with no drawn pixels on the frame is refused rather
than reported as an outline that drew nothing.

Args:
    color: Outline colour.
    thickness: Outline width in pixels (default 1). With `light_angle`, this is the
        width on the edges that face away from the light.
    connectivity: 4 (orthogonal only) or 8 (includes diagonals, default).
    where: "outside" (grow into transparency, default) or "inside"
        (recolour the shape's border pixels).
    light_angle: Degrees, 0 from the right and 90 from above, as the shading tools
        state it. Given, the outline's width varies by which way each edge faces:
        `thickness` where the form turns away from the light, `lit_thickness` where
        it faces into it, and **everything between the two across the band of edge in
        between**.
    lit_thickness: Width on the edges facing the light. 0 drops the outline there
        entirely. Defaults to one pixel less than `thickness`. A value above
        `thickness` is allowed and puts the weight on the lit side instead, which is
        a rim light rather than a weighted outline.

A constant-width border is the single thing that most reliably makes a sprite read as
a die-cut sticker: nothing lit has an edge of uniform darkness, so the eye sees card
stamped out with a punch rather than a form in light. Hand-drawn work in this style
gathers the weight where the surface turns away and lets it vanish on the lit top
faces. `thickness=2, light_angle=135, lit_thickness=0` is that look.

The weight **tapers** rather than switching. The lit and shadow widths are the two ends
of a run of integers, and each edge pixel takes the one its facing selects, so a 2-to-0
keyline passes through 2, then 1, then 0 across a band of edge instead of flipping
between two values at the terminator. Facing is measured over a neighbourhood rather
than over the touching pixels, which is what makes the band continuous on a lumpy
silhouette: at a radius of one, a single-pixel bump swings the facing by ninety degrees
and the keyline comes apart into scraps. Measured by walking the boundary ring of a disc
with twelve bumps on it, the old per-pixel test crossed between outlined and bare 30
times, which is fifteen separate pieces of keyline; the taper crosses twice, which is
one arc. That fragmenting is why `lit_thickness=0` had to be reverted to 1 on this
project's own golem, where it measured better and looked damaged.

With the two widths one apart there are only two integers to choose from and the
changeover sits at the same facing the old comparison used, so
`thickness=2, lit_thickness=1` draws exactly what it drew before. The taper appears once
they differ by two or more, which is the case that was broken.

Reports `outline_weights` alongside the lit and shadow counts: how many of the
silhouette's own boundary pixels took each thickness, from 0 upward. That is the number
that says whether a pass tapered or switched, since a switch leaves the entries between
its two widths empty.

For an outline in colours taken from the artwork's own ramp rather than one flat
colour, see `outline_smart`, which varies hue instead of width.

A Background is refused, in either colour mode: every pixel on one is drawn, so an
outline has no empty pixel to go into or grow from. Outline the art on its own layer;
on an indexed sprite, `convert_background_to_layer` turns the transparent index back
into transparency first.

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": {
      "filename": "<filename>",
      "color": "<color>"
    },
    "name": "add_outline"
  }
}

Input Schema

NameRequiredDescriptionDefault
colorYes
frameNoDefault: 1.
layerNo
whereNoDefault: "outside".outside
filenameYes
thicknessNoDefault: 1.
light_angleNo
connectivityNoDefault: 8.
lit_thicknessNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • addedInput schema / properties / light_angle
      Added value: +{
      +  "type": "number"
      +}
    • addedInput schema / properties / lit_thickness
      Added value: +{
      +  "type": "integer"
      +}
  2. Changed15 schema fields changedv0.10.0
    • removedInput schema / properties / color / title
      Removed value: -"Color"
    • addedInput schema / properties / connectivity / description
      Added value: +"Default: 8."
    • removedInput schema / properties / connectivity / title
      Removed value: -"Connectivity"
    • 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 / thickness / description
      Added value: +"Default: 1."
    • removedInput schema / properties / thickness / title
      Removed value: -"Thickness"
    • addedInput schema / properties / where / description
      Added value: +"Default: \"outside\"."
    • removedInput schema / properties / where / title
      Removed value: -"Where"
    • removedInput schema / title
      Removed value: -"add_outlineArguments"
  3. First observedv0.7.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations only say readOnlyHint=false and openWorldHint=false, so the description carries the load and does add real behavior: refusal of empty layers/frames and Backgrounds, same-layer drawing only, taper-vs-switch semantics, and the outline_weights report. However the extended design-rationale passages (sticker metaphor, golem anecdote, 30-crossings measurement) are narrative rather than operational disclosure, and failure modes like invalid colour strings or missing files are unaddressed.

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?

Purpose is front-loaded, then parameters, then behavioral caveats, which is the right order. It is over-long for a tool description: the die-cut sticker reflection, the golem regression anecdote, and the boundary-ring measurement are illustrative rather than necessary for correct invocation, and could be trimmed without losing callable information.

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 9-parameter mutation tool with no output schema and minimal annotations, the definition covers purpose, parameter meaning, refusal conditions, and the shape of the reported outline_weights. The taper-versus-switch distinction is exactly the kind of non-obvious behavior an agent needs, though output structure beyond outline_weights and error handling remain thin.

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

Parameters5/5

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

With schema coverage at 44%, the description supplies the missing meaning well: color, thickness (including its reinterpretation under light_angle), connectivity 4/8, where outside/inside, light_angle's degree convention, and lit_thickness including its default and above-thickness rim-light behavior. Only filename, frame, and layer remain uninterpreted, and layer's behavior is covered by the same-layer statement in the prose.

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?

Opening line gives a specific verb and resource (add a pixel outline around artwork on a layer) plus the distinguishing modifier (optionally weighted by light). The second paragraph clarifies scope precisely: it outlines art already on the given layer and cannot keyline a fresh empty layer, which separates it from sibling outline_smart.

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?

Explicitly routes the agent: use outline_smart for ramp-derived colours instead of one flat colour, use convert_background_to_layer on indexed sprites first, and a Background is refused. It also names the canonical weighted-look invocation (thickness=2, light_angle=135, lit_thickness=0) and explains the rim-light inversion.

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