Skip to main content
Glama

Crop image

image_crop
Read-onlyIdempotent

Crop images to a pixel box or common aspect ratio, with centered or edge-aligned positioning, and save as JPEG, PNG, WebP, or AVIF.

Instructions

Crop an image to a pixel box (x, y, width, height) or to an aspect ratio (1:1, 4:5, 3:2, 16:9, 9:16, "W:H" or a number), taking the largest centred region (or aligned to an edge with position). Boxes are kept inside the image. Output JPEG/PNG/WebP/AVIF, name -x.. Web version: https://s3eidat.github.io/image-resize/

Input Schema

NameRequiredDescriptionDefault
xNoLeft edge of the crop box (pixels). Use with y, width, height.
yNoTop edge of the crop box (pixels).
imageYesThe image: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI).
ratioNoAspect ratio as "W:H" (e.g. "1:1", "4:5", "3:2", "16:9", "9:16"), a number (width/height), "orig" or "free".
widthNoWidth of the crop box (pixels).
formatNoOutput format. "keep" = same as the input when it is JPEG/PNG/WebP (else PNG). Default keep.keep
heightNoHeight of the crop box (pixels).
outputNoWhere to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set).
qualityNoQuality 1-100 for JPEG / WebP / AVIF (ignored for PNG). Default 90, same as the website.
positionNoWhere the ratio crop sits. Default center (the website default).center
returnBase64NoAlso return the output as base64 in the result (only for small files). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotent/openWorld=false, so the safety profile is covered. The description adds genuinely useful behavior: boxes are clamped inside the image, the largest centered region is taken by default, edge alignment via position, and the default output folder. It doesn't state the return shape, but the naming convention hints at it.

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?

Dense and front-loaded: the two modes come first, then alignment, clamping, formats and naming. The trailing web URL is marginal but harmless. Every sentence carries operational information without padding.

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 an 11-parameter tool with no output schema, the description covers both modes, alignment, clamping, format/quality, and output naming/location well enough to call correctly. It lacks an explicit statement of the result payload (e.g., returned path/dimensions), leaving a minor gap, but the naming pattern compensates substantially.

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%, so parameters are already fully documented. The description restates the ratio and box semantics but adds little beyond the schema (e.g., no extra detail on returnBase64 limits or output folder resolution beyond what the schema says). Baseline 3 is appropriate.

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 (image) with the two supported modes spelled out (pixel box vs aspect ratio), plus output formats and naming. This clearly distinguishes it from siblings like image_resize and image_convert, whose purpose is scaling/converting rather than region extraction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

Clearly explains the two usage modes and how they map to parameters (x/y/width/height for boxes, ratio for aspect, position for alignment). It does not explicitly name alternatives or state when-not to use it (e.g., use image_resize to scale instead), so it stops short of full routing guidance.

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

Deploy Server

Other Tools