Skip to main content
Glama

Resize image

image_resize
Read-onlyIdempotent

Resize images by pixel dimensions or percentage while preserving aspect ratio, with crop/fit options, presets, and output formats to prepare files for social, web, or print.

Instructions

Resize an image by pixels or percent, keeping the aspect ratio. Give width or height (the other side follows), or both: fit "cover" (default, as on the website) centre-crops to that ratio first so nothing is stretched, "contain" fits inside the box, "fill" stretches. Optional crop ratio (1:1, 4:5, 3:2, 16:9, 9:16, orig) or crop box before resizing, social-media presets, output JPEG/PNG/WebP/AVIF. Up to 16384 px a side. Output name: -x.. Web version: https://s3eidat.github.io/image-resize/

Input Schema

NameRequiredDescriptionDefault
fitNoWhen both width and height are set: cover (crop to fill, default), contain (fit inside), fill (stretch).cover
cropNoCrop box (x, y, width, height in pixels) applied before resizing; overrides ratio.
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".
widthNoTarget width in pixels.
formatNoOutput format. "keep" = same as the input when it is JPEG/PNG/WebP (else PNG). Default keep.keep
heightNoTarget height in 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).
presetNoExact output size preset: instagram-post 1080×1080, instagram-portrait 1080×1350, story 1080×1920, youtube-thumbnail 1280×720, x-header 1500×500, facebook-cover 851×315, linkedin-banner 1584×396, full-hd 1920×1080, passport-35x45 413×531, us-passport-2x2 600×600.
percentNoScale by percent instead (e.g. 50 halves both sides, 200 doubles).
qualityNoQuality 1-100 for JPEG / WebP / AVIF (ignored for PNG). Default 90, same as the website.
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

A3.7/5.0
Behavior4/5

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

Beyond the annotations, the description discloses the 16384 px per-side cap, the output naming convention <name>-<W>x<H>.<ext>, the format default behavior, and the ordering fact that a crop is applied before resizing and overrides ratio. The only tension is that it describes writing output files while annotations claim readOnlyHint=true; this reads as a pure-transform-plus-new-file pattern rather than a true contradiction, but it is worth noting.

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 core verb and aspect-ratio rule lead, followed by progressively optional features (fit, crop, presets, format, size cap, naming), which is a sensible information hierarchy. The middle fit/crop clause is dense and slightly run-on, costing a bit of scannability.

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 12-parameter tool with a nested crop object and no output schema, the description covers behavior, limits, and the naming of the written file, which is what an agent needs to call it. It stops short of saying what the tool returns (path vs. metadata) and whether the result is ever returned inline except via returnBase64.

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 100%, so all twelve parameters are already self-documented; the description mainly restates them. It does add relational meaning the schema lacks — width/height interdependence, crop-before-resize precedence, and fit's 'nothing is stretched' rationale — but presets are only listed, not mapped to sizes, and output/returnBase64 semantics are left to the schema.

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?

The opening sentence is a specific verb+resource statement ('Resize an image by pixels or percent, keeping the aspect ratio') and the rest enumerates the exact levers (fit modes, crop ratio/box, presets, formats). It does not name sibling tools, so an agent must infer on its own why image_resize rather than image_crop or image_convert.

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 of the parameters is well explained ('Give width or height (the other side follows), or both'), and the fit modes are given concrete semantics. However, there is no when-to-use/when-not guidance relative to the sibling image tools (image_crop, image_convert, image_compress), and no stated prerequisites about input image accessibility.

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