Skip to main content
Glama

apply_color_curve

Remap pixel tones through a custom curve to adjust brightness and contrast selectively across RGB or individual channels while preserving palette colors and transparency.

Instructions

Remap every tone through a curve: the tonal control brightness and contrast lack.

Brightness moves every tone by the same amount and contrast pivots them all around
the middle. A curve says what each input tone becomes, so shadows can be lifted
without touching the highlights, a flat midrange pulled apart while the ends stay
pinned, or one channel warmed on its own.

**It cannot add a colour.** A curve maps each input tone to exactly one output tone,
so a sprite drawn in five colours comes out in five colours or fewer, and no pixel
becomes part transparent. That is what separates this from a convolution kernel
(blur, sharpen, emboss), which on a clean five-colour orb produced 89 colours and 208
semi-transparent pixels, measured. Curves are safe on finished pixel art; kernels are
not, which is why this server exposes the one and not the other.

Args:
    points: The curve's corners, as `[[input, output], ...]` with every value from 0
        to 255 and the inputs climbing. `[[0, 0], [128, 192], [255, 255]]` lifts the
        midtones and pins the ends; `[[0, 255], [255, 0]]` inverts; a single point
        flattens every tone to its output. Between corners the curve runs straight,
        and outside the first and last it holds their values, which is what Aseprite's
        own Color Curve does (measured, and reproduced here rather than called, so the
        selection, the pixel counters and indexed palettes all behave as they do for
        every other pass).
    channel: "rgb" (default) moves all three together, or "red", "green" or "blue"
        for one. A grayscale sprite takes "rgb", which moves its single value.
    layer: Target layer (default: the top one). frame: 1-based.

Only drawn pixels are visited, as with every other per-pixel pass here, so a curve
never fills in transparent 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": {
      "filename": "<filename>",
      "points": "<points>"
    },
    "name": "apply_color_curve"
  }
}

Input Schema

NameRequiredDescriptionDefault
frameNoDefault: 1.
layerNo
pointsYes
channelNoDefault: "rgb".rgb
filenameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint=false annotation, the description discloses the critical behavioral properties of a destructive pass: it cannot introduce new colors or partial transparency (five colors in, five or fewer out), only drawn pixels are visited so transparent canvas is never filled, and selection, pixel counters and indexed palettes behave as in every other pass. It also specifies curve interpolation (linear between corners, clamped outside) and that the implementation is reproduced locally rather than delegated.

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?

The core constraint (what a curve can and cannot do) is front-loaded before the args, and the measured kernel comparison is load-bearing evidence rather than filler. Some phrasing is editorial ("the tonal control brightness and contrast lack", repeated "measured") and the block is long, but trimming it would cost real 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 mutating tool with no output schema and sparse schema descriptions, the definition covers inputs, interpolation semantics, affected pixels, and color-count invariants thoroughly. It stops short of stating what the tool returns (e.g., a modified-file confirmation or pixel counts) and says nothing about failure cases such as out-of-range or non-monotonic points.

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

Parameters4/5

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

With schema coverage at only 40% and an untyped items:{} array, the description carries the parameter burden well: points format `[[input, output], ...]`, 0-255 range, monotonically climbing inputs, worked examples (midtone lift, inversion, single-point flatten), channel enum values with default and grayscale behavior, and layer/frame defaults. Only `filename` goes undescribed, and its meaning is self-evident from the required-field pairing.

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?

"Remap every tone through a curve" names a specific verb and resource, and the description immediately differentiates it from brightness/contrast (uniform shift / midpoint pivot) and from convolution kernels (blur, sharpen, emboss). An agent can tell what this tool does and what it is not without 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 Guidelines4/5

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

It gives concrete selection contexts (lift shadows without touching highlights, spread a flat midrange, warm one channel) and an explicit exclusion: kernels are unsafe on finished pixel art, which is why the server exposes curves instead. It does not name the sibling tools to use for uniform brightness/contrast work, so routing guidance is strong but not fully enumerated.

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