Skip to main content
Glama

Select rectangle

gimp_select_rectangle

Select a rectangular pixel region in a GIMP image and combine it with the current selection using replace, add, subtract, or intersect; feather edges and ignore areas outside the canvas.

Instructions

Select a rectangle (image pixels, origin top-left) combined with the current selection. The part outside the canvas is ignored. Selections are part of the image (undoable, saved in XCF).

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>",
      "x": "<x>",
      "y": "<y>",
      "width": "<width>",
      "height": "<height>"
    },
    "name": "gimp_select_rectangle"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
imageYesImage id from gimp_status, e.g. 'image:1@a1b2c3d4'.
widthYes
heightYes
featherNoFeather radius in pixels (0 = hard edge).
operationNoHow the new shape combines with the current selection.replace

Output Schema

NameRequiredDescriptionDefault
emptyYes
imageYes
boundsYesBounding box of the selection, clipped to the canvas; null when empty.
containsNoWhether (probe_x, probe_y) is selected (> 50%), when a probe point was given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations declare a non-read-only but non-destructive operation, and the description adds genuinely useful context beyond them: out-of-canvas geometry is clipped, and selections are undoable and persisted in XCF. It does not mention that the default operation overwrites the existing selection, which is the one behavioral detail an agent most needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, zero filler, with the coordinate convention and clipping rule front-loaded before the persistence note. Nothing repeats the tool name or restates schema fields verbatim.

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 output schema exists, so return values need no explanation, and the description covers coordinate space, clipping, and undo/persistence for a 7-parameter mutation tool. The remaining gap is that the default selection-replacement behavior and feather interaction are not surfaced, which matters given the tool's mutating effect on selection state.

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

Parameters3/5

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

Schema coverage is only 43%, with x, y, width and height carrying no descriptions; the description partially compensates by specifying the pixel/origin convention and the clipping rule. However, feather and operation semantics are left entirely to the schema's short blurbs, and the interaction between 'combined with the current selection' and operation='replace' is unexplained.

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?

States a specific verb and resource ('Select a rectangle'), plus the coordinate convention (image pixels, origin top-left) that distinguishes it from sibling selection tools like gimp_select_ellipse. The phrase 'combined with the current selection' is slightly at odds with the schema default operation='replace', which muddies the exact scope a bit.

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 by the name and shape, but the description never says when to choose this over gimp_select_ellipse, gimp_modify_selection, or gimp_get_selection, nor does it state prerequisites such as needing an active image id from gimp_status. An agent must infer routing from sibling names alone.

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