Skip to main content
Glama

Crop image

gimp_crop_image
Destructive

Crop an image to a specified pixel rectangle inside the canvas, discarding outside pixels in one undoable step.

Instructions

Crop the image to the rectangle (x, y, width, height) in image pixels, which must lie inside the canvas. Destructive: layer pixels outside the rectangle are discarded. One undo step.

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_crop_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYes
yYes
imageYesImage id from gimp_status, e.g. 'image:1@a1b2c3d4'.
widthYesPixels.
heightYesPixels.

Output Schema

NameRequiredDescriptionDefault
dirtyYes
imageYes
widthYes
heightYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, and the description goes beyond that by naming exactly what is lost (layer pixels outside the rectangle) and what happens to existing layers when the rectangle is clipped. The "One undo step" note adds genuine reversibility information not present in the annotations. The only gaps are edge-case behavior for layers smaller than the crop rectangle.

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, front-loaded with the action and geometry, then the destructive consequence, then reversibility. Every clause carries information an agent needs and there is no filler.

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 destructive five-parameter mutation tool this is sufficiently complete: the geometry, the containment constraint, what is destroyed, and undo scope are all stated, and an output schema exists so return values need no explanation. Nothing material is missing.

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 only 60%, with x and y carrying no descriptions at all, so the description must compensate. It does by declaring all four coordinate parameters to be in image pixels and by binding them to a rectangle that must lie within the canvas. It leaves the origin convention (upper-left corner vs center) implicit, which is the one remaining ambiguity for the undocumented x/y parameters.

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?

"Crop the image to the rectangle (x, y, width, height)" gives a specific verb, resource, and geometry, which is enough to distinguish it from gimp_resize_canvas or gimp_resize_image by intent. It stops short of naming those siblings explicitly, so an agent must infer the crop-vs-resize distinction from general knowledge.

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?

The prerequisite that the rectangle "must lie inside the canvas" is a real usage constraint that will prevent failed calls. However, there is no explicit when-to-use guidance, no statement about when to prefer gimp_resize_canvas or gimp_select_rectangle instead, and no mention of whether a selection is required or produced.

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