Skip to main content
Glama

select

Destructive

Make a selection, saved as a NAMED channel (no live selection persists between calls): rectangle, ellipse, polygon, colour range, magic wand, layer transparency, gradient, or another channel. Combine with add, subtract or intersect by reusing a name. Use the channel as add_adjustment's or add_effect's mask when creating a filter, or layer_mask for a real layer mask. Make selections after straighten, resize and crop. For a sky or a subject, select_with_ai (target sky or subject) makes a cleaner mask than these: colour range on a sky that shades from light to dark catches only part of it and leaves a hard band, and a hand-drawn polygon leaves halos along edges. Check a selection with selection_preview before using it. gradient_linear: nothing is selected at the start point (x1, y1), rising to fully selected at the end point (x2, y2); invert swaps the ends. gradient_radial: fully selected at the center, fading to nothing at the radius.

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": {
      "image": "<image>",
      "mode": "<mode>"
    },
    "name": "select"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNorectangle/ellipse/magic_wand, or color_range's sample point: left edge or point x, in image pixels from the canvas origin, also when `layer` names a layer that sits at an offset (never counted from that layer's own corner).
yNorectangle/ellipse/magic_wand, or color_range's sample point: top edge or point y, in image pixels from the canvas origin, also when `layer` names a layer that sits at an offset (never counted from that layer's own corner).
cxNogradient_radial: center x, document pixels. Default the image's own center.
cyNogradient_radial: center y, document pixels. Default the image's own center.
x1Nogradient_linear: start point x, document pixels. Default 0.
x2Nogradient_linear: end point x, document pixels. Default the image's width.
y1Nogradient_linear: start point y, document pixels. Default 0.
y2Nogradient_linear: end point y, document pixels. Default 0.
modeYesrectangle/ellipse: x, y, width, height. polygon: points (>=3 [x,y] pairs). color_range: every pixel near `color` (hex) or the colour at a sample point x,y, anywhere in the image. magic_wand: the contiguous region around x,y. alpha: a layer's opaque pixels. channel: copy another saved selection (`source`). gradient_linear: a ramp from (x1,y1) to (x2,y2), default the full image width. gradient_radial: a ramp from full effect at the center (cx,cy) fading to none at radius, default centered at the image's own center with radius = half the shorter side.
nameNoChannel to save the selection in (replaced).Selection
colorNocolor_range: a hex colour like "#c0392b".
imageYesImage id, as returned by open_photo.
layerNoLayer name. Defaults to the selected layer, or the topmost layer if none is selected. alpha: which layer. color_range/magic_wand: only matters when sample_merged:false (otherwise the visible composite is sampled, and which layer this names makes no difference to the result).
widthNorectangle/ellipse: width, document pixels.
heightNorectangle/ellipse: height, document pixels.
invertNoApplied to the NEW shape alone, before any `combine`. rectangle/ellipse/polygon/color_range/magic_wand/alpha/channel: invert the selection. gradient_linear/gradient_radial: swap which end is black vs white.
pointsNopolygon: 3-10,000 [x, y] pairs, document pixels.
radiusNogradient_radial: radius, document pixels. Default half the shorter image side.
sourceNomode=channel: the saved selection to copy.
combineNoCombine with the existing saved selection of the same `name` (like shift/alt in a GUI). `invert`/`feather_px` apply to the NEW shape alone, before it is combined.replace
layer_idNoLayer id, as inspect (and any tool that creates a layer) reports it. Takes priority over `layer`, and is the only way to address one of two layers that share a name. alpha: which layer. color_range/magic_wand: only matters when sample_merged:false.
thresholdNocolor_range/magic_wand tolerance, 0-255.
feather_pxNoFeather radius in document pixels, applied to the NEW shape alone before any `combine`. Refused (nonzero) on gradient_linear/gradient_radial -- already a continuous ramp, nothing to feather.
sample_mergedNocolor_range/magic_wand: sample the visible composite. false samples the one named/selected layer's own raw pixels instead.

Output Schema

NameRequiredDescriptionDefault
channelNo
fractionNo
selected_pixelsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the bar is lowered, but the description still adds real value: it discloses that selections are persisted as named channels rather than live state, and that add/subtract/intersect works by reusing a name. It does not spell out that reusing an existing name overwrites the previously saved selection (only the schema's '(replaced)' hints at it), which is the main destructive behavior an agent should know about.

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?

Purpose and the state-persistence constraint are front-loaded, and the middle section is dense with genuinely actionable routing guidance. The closing gradient paragraphs repeat material already present in the mode and invert parameter descriptions, so the description is longer and less tidy at the tail than it needs to be.

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?

For a 24-parameter tool with a full output schema, this covers everything an agent needs to choose and call it correctly: what it produces, how to consume the output downstream, ordering relative to crop/resize/straighten, the AI alternative, verification, and gradient directionality. Parameters are otherwise fully documented in the schema, so no critical gap remains.

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 description coverage is 100%, so the baseline is 3; the description earns above baseline by explaining what the gradient modes actually mean in selection terms — nothing selected at the start point rising to fully selected at the end, and invert swapping the ends — which is semantic meaning rather than a restatement of types. Other high-cardinality parameters (threshold, feather_px, sample_merged, combine) get no treatment in the description and are left entirely to the schema.

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?

Opens with a specific verb+resource ('Make a selection') plus a crucial scope fact that the name alone cannot convey: the result is saved as a NAMED channel and no live selection persists between calls. It enumerates the supported modes (rectangle, ellipse, polygon, colour range, magic wand, layer transparency, gradient, channel), which lets an agent distinguish it from select_with_ai, modify_selection, and selection_preview 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 Guidelines5/5

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

It explicitly routes the agent: use the channel as add_adjustment's or add_effect's mask, or layer_mask for a real layer mask; do selection work after straighten/resize/crop; check results with selection_preview; and prefer select_with_ai for sky/subject with a concrete reason (colour range leaves a hard band on a gradient sky, hand-drawn polygons leave halos). This names alternatives and the conditions that select them, not just a general context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources