Skip to main content
Glama

Resize an image

image_resize

Resize images to exact dimensions or by percentage, fit within a box using contain, cover, fill, inside, outside, or pad modes, and optionally change format and filter.

Instructions

Resize by width, height, percentage, or to fit a box. Supports contain, cover, fill, inside, outside and pad fit modes, all resampling filters, and optional format change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fitNocontain (fit inside, keep ratio), cover (fill and crop), fill (stretch), inside (contain but never enlarge), outside (cover without cropping), pad (contain then pad)contain
urlNohttp(s) URL to fetch. Disabled unless PICTOR_ALLOW_NET_FETCH=true.
pathNoPath to the image, relative to an allowed input root (or absolute inside one).
widthNoTarget width in pixels.
filterNonearest, box, bilinear, hamming, bicubic, lanczos, or auto.
heightNoTarget height in pixels.
gravityNoAnchor for cover cropping or padding, e.g. center, top, bottom-right.center
percentNoScale by this percentage of the original.
qualityNoLossy quality 1-100 (higher is better quality and larger).
backgroundNoRGBA fill used by pad and rotate.
base64_dataNoInline image bytes as base64, optionally a data: URI.
only_shrinkNoNever enlarge; leave smaller images untouched.
output_nameNoOverride the output filename (a safe name is derived if omitted).
return_imageNoEmbed the resulting image inline so vision-capable clients can see it.
output_formatNoOutput codec: jpeg, png, webp, avif, tiff, gif, bmp, ico, jpeg2000, qoi, ppm. Defaults to the input format.
return_base64NoInclude the base64 payload in the JSON result for clients without file access.
strip_metadataNoRemove EXIF/GPS/ICC metadata. Defaults to the server setting (on).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
inputNoSummary of the source image, when one was read.
notesNo
stepsNo
metricsNoOperation-specific measurements (e.g. comparison scores).
outputsNo
operationYesTool that produced this result.
sizeChangeNo
inlineImageIncludedNoTrue when an image block accompanies this result for vision-capable clients.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations are entirely absent, so the description carries the full behavioral disclosure burden. It does state supported fit modes, resampling filters, and optional format change, which is meaningful behavioral detail, but it does not disclose side effects, output delivery specifics, network/fetch constraints, or default behavior beyond what appears in the input schema. No contradictions occur.

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?

The description is two sentences with no redundancy: it front-loads the core resizing methods, then lists supported modes, filters, and format changes. Every phrase earns its place, and no unnecessary words or examples dilute the meaning.

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?

Given 17 parameters, a 100% schema-covered input schema, and an output schema, the description does not need to re-explain parameters or return values. However, in a family of 13 sibling tools, it does not add enough disambiguating or decision-level context, and it leaves important usage questions (which input source is required with a network fetch, output naming, whether the result is returned as base64 or filename) unanswered.

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 the baseline is 3 even without extra parameter details in the description. The description adds high-level meaning around resizing by width, height, percentage, or fit box, but it does not enrich individual parameter semantics beyond what the schema already documents.

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 description clearly identifies the action (resize), the resource (image), and the main input modes (width, height, percentage, fit box), plus the supported fit modes and optional format change. It conveys what the tool does and this can help distinguish it from siblings such as image_rotate, but it does not explicitly name or contrast sibling tools, so it is a tier below the strongest examples.

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

Usage Guidelines2/5

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

There is no guidance on when to choose image_resize versus sibling tools like image_thumbnail, image_compress, or image_transform, and no mention of prerequisites, complementary source parameters, or when not to use it. The description simply states the action without helping an agent decide among the many image tools in this family.

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