Skip to main content
Glama

crop

Extract a chosen region from an image using pixel bounds, an aspect ratio, or exact width and height, with gravity placement and optional non-overwriting output.

Instructions

Crop an image. Pick exactly one mode: box=[left, top, right, bottom] in pixels of the upright image; aspect='16:9' (or '1:1', '4:5') for the largest region with that ratio; width= and height= for a window of exactly that size. For aspect and width/height, gravity picks where the region sits: center (default), top, bottom, left, right, top-left, top-right, bottom-left, bottom-right. Out-of-range boxes are an error, not silently clipped. Output: photo.cropped.jpg unless output= is given; never overwrites unless overwrite=true.

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": {
      "path": "<path>"
    },
    "name": "crop"
  }
}

Input Schema

NameRequiredDescriptionDefault
boxNo
pathYes
widthNo
aspectNo
heightNo
outputNo
gravityNocenter
previewNo
qualityNo
overwriteNo
allow_hugeNo
keep_metadataNo

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?

With no annotations at all, the description does meaningful disclosure work: it states that out-of-range boxes are an error rather than silently clipped, that the default output is photo.cropped.jpg, and that existing files are never overwritten unless overwrite=true. It leaves the behavioral effect of preview, quality, allow_huge, and keep_metadata unstated, so it is not fully complete.

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?

The description is front-loaded with purpose, then modes, then gravity, then I/O safety, which is a logical order for an agent to consume. It is dense with no filler, though the semicolon-delimited mode list is slightly harder to scan than a bulleted structure would be.

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 12-parameter mutation tool with no annotations and no output schema, the description covers the geometry and safety essentials but omits the switches that change resource cost and side effects, notably allow_huge, quality, preview, and keep_metadata. An agent could invoke it correctly for the common case but would be guessing on the auxiliary flags.

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 0%, and the description does compensate for the most complex parameters by specifying box order ([left, top, right, bottom] in upright-image pixels), aspect string format, and the full gravity enumeration including 'center' as default. That is genuine added meaning, but five parameters (path, preview, quality, allow_huge, keep_metadata) are undocumented in both description and 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 and resource ('Crop an image') and immediately enumerates the three distinct operating modes, which makes it easy to distinguish from siblings like resize or rotate_flip that operate on the same resource.

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 phrase 'Pick exactly one mode' gives strong intra-tool selection guidance and each mode has a clear condition attached. However, it gives no guidance on when to crop versus resize, convert, or rotate_flip, and it never states what happens if zero or multiple modes are supplied.

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