Skip to main content
Glama

seam_occlusion

Darkens overlapping seams between same-material masses using a mass map with depth values, adding distance-based contact shadow falloff along a color ramp.

Instructions

Darken the seam where two masses of the same material overlap, along its ramp.

`contact_shadow` does ambient occlusion already and finds the form doing the occluding
by colour, which is the one case a figure never presents. An arm against a torso, a
pauldron over a shoulder, a thigh against a hip: both sides are the same stone under
the same light and no colour separates them, so there is nothing for `occluder_color`
to match. Measured on this project's own golem, an armpit where an artist darkens the
contact came out +131 in luminance, because nothing here could see the seam.

What a colour cannot say, the caller can. The map is the same notation
`draw_pixel_map` and `shade_facets` take, one character per pixel, except that the
legend names **masses** instead of colours or directions, and gives each one a `z`.

Args:
    rows: One string per row of the map, one character per pixel. "." is a pixel that
        belongs to no mass, and is neither darkened nor treated as an occluder.
    legend: {symbol: z}, where a **higher z is nearer the viewer**. `{"a": 1, "b": 0}`
        says mass "a" overlaps mass "b", so the seam darkens on "b" and not on "a".
        Occlusion is asymmetric and that is the whole point: darken both sides of a
        seam and you have drawn brickwork, darken the side behind and you have put one
        mass in front of another.
    ramp: Colours darkest first. Darkened pixels stay on this ramp, so conformance is
        preserved by construction.
    radius: How far the darkening reaches from the seam, in pixels. 2 is usually right
        and is what gives the falloff somewhere to happen.
    depth: How many ramp steps darker, against the seam itself, tapering to nothing at
        `radius`. Refused at or above the ramp's length, which would slam the seam to
        the darkest entry whatever was there.
    tolerance: How close a pixel must be to a ramp entry to be darkened, as a weighted
        RGB distance. A pixel further off is left alone, so a seam crossing another
        material does not drag it onto this ramp.
    x, y: Where the map's top-left corner lands on the canvas.
    layer: Target layer (default: top layer).
    frame: Target frame, 1-based.

The darkening **falls off with distance** from the seam rather than being a hard line,
on the same curve `contact_shadow` uses so the two cannot disagree about what a contact
falloff is. That matters more here than it does there: the workaround this replaces, in
this project's golem generator, read seam pixels back in Python and slammed them two
steps down at a fixed width, and the result read as masonry. A combination that cannot
produce a falloff, such as `depth=1` over `radius=2`, is reported as a flat band rather
than passed off as one.

Refuses rather than darkening nothing: a map with one mass, a map whose masses all sit
at the same z, masses that do not come within `radius` of each other, and a pass where
every pixel it reached was already at the ramp's darkest step are each their own
refusal, and each one names the counts behind it.

Reports `masses` (pixels per symbol), `depths` (the z each resolved to), `by_steps`
(how many pixels moved how far, which is the falloff) and `darkened_pixels`.

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>",
      "rows": "<rows>",
      "legend": "<legend>",
      "ramp": "<ramp>"
    },
    "name": "seam_occlusion"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoDefault: 0.
yNoDefault: 0.
rampYes
rowsYes
depthNoDefault: 2.
frameNoDefault: 1.
layerNo
legendYes
radiusNoDefault: 2.
filenameYes
toleranceNoDefault: 24.0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=false; the description goes far beyond by disclosing the asymmetric occlusion rule, the falloff curve shared with `contact_shadow`, and a detailed set of refusal conditions with the counts each reports. It stops short of stating file-write side effects or whether the source layer is replaced, but the mutation profile of a pixel-drawing tool is otherwise well covered.

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 action, then structured into an argument list followed by behaviour and refusal notes, so the important information is easy to find. It runs long and repeats its own falloff argument twice, first with the +131 luminance anecdote and again with the Python seam-pixel workaround, which could be trimmed to one.

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?

An 11-parameter mutating tool with no output schema, and the description supplies the missing return-value documentation (`masses`, `depths`, `by_steps`, `darkened_pixels`) plus refusal semantics for degenerate maps. The only gap is that `filename` is never explained despite being required.

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 55% schema coverage and 11 parameters, the description manually documents nearly every argument: the string-per-row map format with `"."` as unassigned, the legend as symbol→z with the higher-z-nearer rule and a worked example, ramp ordering, radius units, depth constraints (refused at or above ramp length), tolerance as weighted RGB distance, and x/y/layer/frame meaning. Only `filename` is left unexplained.

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?

First sentence gives a precise verb, target (the seam where two masses of the SAME material overlap) and the mechanism (along its ramp). It also explicitly contrasts with `contact_shadow` and why its colour-based occluder matching cannot cover this case, so the agent can separate the two tools without opening either schema.

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?

Names the alternative (`contact_shadow`) and the exact condition that selects this tool instead: both sides are the same material so there is no `occluder_color` to match. It further describes the workaround this replaces and the specific failure it produces (masonry-like hard bands), which tells the caller when this tool is the right 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