Skip to main content
Glama

shade_facets

Shades hard-edged pixel art forms from a direction map, assigning one flat tone per plane so facets read as cut rather than rounded.

Instructions

Shade a form built from flat planes, one tone per plane, from a map of directions.

Args:
    rows: One string per row of the map, one character per pixel, as `draw_pixel_map`
        takes. "." leaves a pixel alone.
    legend: {symbol: facet direction}. A direction is an angle in degrees in the same
        convention as `light_angle` (0 faces right, 90 up, 135 up and to the left),
        the word "front" for a plane square to the viewer, or `[angle, z]` to tilt a
        plane toward the viewer as well, which is how a chamfer is said.
    ramp: Colours darkest first. Facet tones are entries of this and nothing else.
    light_angle, light_z: The key light.
    fill_strength: How much bounce comes back from roughly opposite, as a share of the
        key. Without it every plane facing away from the key clamps to the same
        ambient value and the whole shadow side comes out one flat colour.
    ambient: The floor, so a plane facing away is dark rather than black.
    x, y: Where the map's top-left corner lands.

`shade_region_by_light` reads a surface normal out of how far each pixel sits from the
silhouette's edge. That is right for anything round and wrong for everything hard: a
distance field cannot know where an edge is, so it rounds the form over, and a crate
comes out as a cushion. This takes the normals from the caller instead, because which
way a plane faces is a fact about the drawing that only the person drawing it knows.

Every pixel of one facet gets the same value. That flatness is the point: it is what
reads as cut rather than inflated, and it is the thing a gradient cannot imitate.

Returns the usual write counts plus `facet_steps`, the ramp step each symbol resolved
to, so a caller can see the value structure it just asked for. A pass whose facets all
land on the same step is refused rather than painting a flat fill.

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": "shade_facets"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoDefault: 0.
yNoDefault: 0.
rampYes
rowsYes
frameNoDefault: 1.
layerNo
legendYes
ambientNoDefault: 0.16.
light_zNoDefault: 0.5.
filenameYes
light_angleNoDefault: 135.0.
fill_strengthNoDefault: 0.35.

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?

Beyond the annotations (which only mark it as a mutation with no open-world access), the description discloses the return payload (write counts plus `facet_steps`), the '.' no-op pixel behavior, and the refusal case where all facets resolve to the same ramp step. It does not discuss overwrite semantics for already-painted pixels or ordering relative to other layer operations, which keeps it from a 5.

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 statement, then args, then rationale; the arg block is dense but each line adds meaning. The comparison paragraph on distance fields is longer than strictly necessary for selection purposes, though it doubles as usage guidance.

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 12-parameter mutation with a nested legend object and no output schema, the description explains the inputs that actually require judgment and summarizes return values. The only gap is silence on filename, frame, and layer, which are apparently conventional across the sibling set.

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 58% schema coverage and no enums, the description carries the parameter burden well: it defines the legend direction convention (degrees as in `light_angle`, the literal 'front', or an [angle, z] tuple for chamfers), states that ramp is darkest-first and is the only source of tones, and explains light_z, fill_strength as a share of the key, and ambient as the floor. Only filename/frame/layer are left to convention.

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?

States a specific verb and resource ('Shade a form built from flat planes, one tone per plane, from a map of directions') and immediately distinguishes the approach from the sibling that reads normals from a distance field. An agent knows exactly what operation this performs before opening the 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?

Explicitly names `shade_region_by_light` and the condition that selects it instead ('right for anything round and wrong for everything hard'), with the crate-versus-cushion contrast as a concrete decision rule. This is real when-to-use/when-not guidance rather than inference.

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