Skip to main content
Glama

paint_selection

Set an exact pixel selection mask to constrain later raster edits, using rectangles, polygons, ellipses, inversion, feathering, growth, shrinking, flood fill, or layer opacity.

Instructions

Set an exact pixel selection mask immediately. rectangle=[left,top,right,bottom], document pixels, corners in any order; may extend past the canvas; zero size selects nothing. antialias=false gives hard 0/255 edges (polygons use the pixel-centre rule, [x0,x1)). smooth=true makes a polygon a smooth curve through its points. from_layer/flood read layer_id (default active); from_layer threshold 1..255 selects pixels at least that opaque, hard. feather/grow/shrink radius <=100; grow/shrink are round (Euclidean), so circles stay circles. Flood tolerance 0..255 (binary). Selection constrains subsequent raster operations.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "paint_selection"
  }
}

Input Schema

NameRequiredDescriptionDefault
pointNo
actionNonone
pointsNo
radiusNo
smoothNo
layer_idNoTarget layer id or unique layer name; the active layer stays unchanged. Default: active layer
antialiasNo
operationNoreplace
rectangleNo
thresholdNo
toleranceNo
document_idNoTarget this document instead of the shared active one (recommended when several agents share the server)
sample_mergedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations at all, the description carries the entire burden and does substantial work: it discloses that coordinates are document pixels, that rectangles may extend past the canvas, that zero size selects nothing, hard 0/255 edge behavior, polygon pixel-centre rules, and numeric bounds (threshold 1..255, radius ≤100, tolerance 0..255). It omits error behavior, whether the operation is undoable, and what happens with no active document, 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?

It is front-loaded and terse, with each clause carrying a distinct rule rather than filler. The telegraphic, semicolon-heavy style is dense but not padded; a light restructuring by parameter would aid scanning but nothing should be cut.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter, zero-annotation tool this covers the geometric and threshold semantics well, but the two enum parameters that drive which action actually executes are left undocumented, and there is no output schema to fall back on. Adequate but with a material gap for an agent choosing an action.

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?

Schema coverage is only 15%, so the description must compensate, and it largely does: it maps rectangle, antialias, smooth, layer_id, threshold, radius, and tolerance to concrete meaning and ranges. The notable gaps are the 'operation' enum (replace/add/subtract/intersect) and the 'action' enum, neither of which is explained anywhere.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource: 'Set an exact pixel selection mask immediately.' That is far more than a restatement of the name, and the word 'immediately' hints at the distinction from a deferred/modal selection workflow. It does not name a sibling tool or say explicitly how it differs from paint_region or paint_shape, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

Usage is implied rather than stated: 'Selection constrains subsequent raster operations' tells the agent why to call it, but there is no explicit when-to-use, when-not-to-use, or named alternative. The reader must infer that this is the tool for mask creation versus painting pixels.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.