Skip to main content
Glama

Crop

photopea_crop
Destructive

Crop the active document to a specified pixel rectangle, discarding all content outside the bounds. Use it to remove unwanted edges or focus on a precise image region.

Instructions

Crop the active document to a rectangle in pixels. Content outside the rectangle is discarded. Use get_document_info for the current size; use resize_canvas to add space instead.

Input Schema

NameRequiredDescriptionDefault
xYesLeft edge of the crop rectangle in pixels
yYesTop edge of the crop rectangle in pixels
widthYesWidth of the crop rectangle in pixels
heightYesHeight of the crop rectangle in pixels

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.4/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 safety is covered structurally; the description nevertheless makes the destruction concrete by naming what is lost ('content outside the rectangle is discarded'). It does not cover return value, undo interaction, or bounds behavior for out-of-range rectangles, which keeps it below 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.

Conciseness5/5

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

Three short sentences, front-loaded with the operation and its destructive consequence before the alternative-tool routing. No sentence restates the title or wastes tokens.

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 four-required-parameter, fully documented destructive operation with no output schema, the description supplies enough to call it correctly and to know what it costs. Only minor gaps remain, such as what happens if the rectangle extends past the canvas bounds or how the result is confirmed.

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 description coverage is 100%, with each of x, y, width, and height documented including edge semantics and exclusiveMinimum on the dimensions. The description adds only the pixel-unit framing that the schema already states, so the baseline of 3 applies.

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?

States a specific verb (crop) and resource (the active document) plus the exact shape of the operation (a rectangle in pixels). It is immediately distinguishable from the many layer-oriented siblings and from resize_canvas, which it names explicitly.

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?

Gives both a preparatory step (use get_document_info for the current size) and an explicit when-not alternative (use resize_canvas to add space instead). The agent needs no further inference to choose between the two canvas-geometry tools.

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