Skip to main content
Glama

surface_emission

Lights an interior source onto surrounding pixel-art surfaces by moving nearby pixels up their existing color ramp with distance-based falloff, preserving shading instead of flattening tones.

Instructions

Light an interior source onto the surface around it, up that surface's own ramp.

`glow` builds a halo on a layer **below** the artwork, and its docstring says plainly
that "a body blocks the halo of a gem inside it". So a glowing core inside a silhouette
gets nothing at all: on this project's golem, `glow` contributed zero pixels to the
export, which was confirmed by counting the colours in the committed PNG (nine: eight
stone steps and one core colour), and the longest comment in the old generator defended
a layer with nothing on it. What light from an interior source actually does is warm the
surface it sits in, and that is this.

It is neither a halo nor a gradient. Each pixel within `radius` of the source is moved
**up the ramp it is already on**, by a number of steps that falls off with distance, so
the surface keeps its own form: a crack near the core stays darker than the stone around
it, and both brighten. Painting a colour per ring instead, which is what a hand-rolled
bloom does, flattens every tone inside the radius to one value and reads as a gradient
laid over the figure.

Args:
    ramp: Colours darkest first, and **the ramp the surface is painted on**: this moves
        pixels along it, so a pixel further than `tolerance` from every entry is left
        alone rather than dragged onto a palette it was never on. The warmth therefore
        comes from the ramp's upper end, which is where a hue-shifted ramp is warm
        (`generate_ramp` with `light_hue`). To tint as well as brighten, hand it a ramp
        built from the surface's midtone up into the source's colour and the lift walks
        into that hue.
    source_color: The colour of the thing emitting, for example a gem or a molten core.
        Source pixels are never repainted; they are where the light comes from.
    radius: How many rings of surface the light reaches, in pixels.
    depth: How many ramp steps the ring touching the source is lifted. The outermost
        ring is always lifted by at least 1, because a ring that moves nothing should
        not be in the radius. Refused at or above the ramp's length.
    falloff: "quadratic" keeps the lift concentrated near the source, which is how light
        falls off and what reads as a source; "linear" spreads it evenly.
    tolerance: How close a pixel must be to a ramp entry to be lifted, as a weighted RGB
        distance.
    source_tolerance: How close a pixel must be to `source_color` to count as the
        source. Defaults to `tolerance`, and it wants to be **tight** for the reason
        `contact_shadow` documents at `occluder_tolerance`: the source is a flat colour
        you named, while `tolerance` has to stay loose enough for shaded art that
        varies, and one number cannot be both. The result warns when `source_color`
        cannot be told apart from a ramp entry, because then the surface is partly its
        own source and the light spreads from the wrong pixels.
    layer: The layer whose surface is lit, and the one written (default: top layer).
    frame: Target frame, 1-based.

**Why this is not an argument to `glow`.** `glow` writes a new layer below the subject
and promises the subject's cel is untouched, so deleting one layer removes the effect;
this writes into the subject's cel, because light landing on a surface is part of that
surface. `glow` paints only where the art is not; this paints only where the art is.
`glow` refuses when it runs out of room outside the silhouette; this refuses when it
finds no surface on the ramp inside it. An argument that reversed all three would be two
tools sharing one name, and it would make `glow`'s central promise conditional on a flag.

Refuses rather than reporting a pass that did nothing: no pixel matching `source_color`
is an error, and so is a source with no surface on the declared ramp around it. The
refusal carries the counts that say which it was.

Reports `per_ring`, how many pixels were lifted at each distance, which is the number
that says the falloff happened, alongside `lifts`, the steps each ring was given.

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>",
      "ramp": "<ramp>",
      "source_color": "<source_color>"
    },
    "name": "surface_emission"
  }
}

Input Schema

NameRequiredDescriptionDefault
rampYes
depthNoDefault: 3.
frameNoDefault: 1.
layerNo
radiusNoDefault: 4.
falloffNoDefault: "quadratic".quadratic
filenameYes
toleranceNoDefault: 24.0.
source_colorYes
source_toleranceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false and openWorldHint=false; the description goes far beyond by stating that it writes into the subject's cel (not a separate layer), that source pixels are never repainted, that depth is refused at or above the ramp's length, that it errors when no pixel matches `source_color` or no surface lies on the ramp, that a warning fires when `source_color` collides with a ramp entry, and that the refusal carries diagnostic counts. That is exactly the destructive/permission/edge-case context annotations cannot supply.

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

Conciseness3/5

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

The purpose is front-loaded and the parameter block is well structured, but the definition is padded with project narrative — the golem, the count of nine colours in the committed PNG, and the "longest comment in the old generator" — that argues a design decision rather than helping an agent call the tool. The glow-comparison content is genuinely useful, but it is delivered at essay length.

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?

There is no output schema, and the description compensates by naming the returned fields (`per_ring`, `lifts`) and what they signify. Combined with mutation semantics, refusal conditions, warning behaviour, and per-parameter meaning, an agent has everything needed to invoke this correctly on the first try.

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 only 50% schema coverage, the description carries the load and does: it explains that `ramp` is the surface's own palette and that out-of-tolerance pixels are left alone, that `depth` is the lift of the innermost ring with the outermost always at least 1, the perceptual difference between "quadratic" and "linear" falloff, the meaning of `tolerance` as weighted RGB distance, and why `source_tolerance` should be tighter than `tolerance`. Only `filename` is left undocumented, which is self-evident.

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?

The first sentence names a specific verb and resource ("Light an interior source onto the surface around it, up that surface's own ramp") and immediately scopes it against a sibling. The follow-up paragraph makes the mechanism concrete — pixels move up the ramp they already belong to rather than receiving a painted ring of colour — so an agent knows exactly what class of operation this is.

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?

The "Why this is not an argument to `glow`" section gives three explicit, discriminating conditions (layer below vs. subject's cel, paints where art is not vs. where art is, refuses on room outside silhouette vs. no surface on ramp inside it). It also points to `generate_ramp` for building a warm/tinting ramp and to `contact_shadow`/`occluder_tolerance` for the tolerance rationale, so the agent is routed to the right companions.

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