Skip to main content
Glama

image_resize

Read-onlyIdempotent

Resize an image with a width, a height or both (one alone keeps the aspect ratio). fit: fill (default, stretches to exactly width x height), contain (fits inside and pads with backgroundColor), cover (fills the box and crops the overflow around the centre), inside (fits within, keeps the ratio), outside (at least as large, keeps the ratio). withoutEnlargement never makes it bigger. Reads and writes JPEG, PNG, WebP, AVIF, GIF (animation kept), TIFF; the first text item is the picture as base64, the second a JSON note with its size

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": {
      "fileBase64": "<fileBase64>"
    },
    "name": "image_resize"
  }
}

Input Schema

NameRequiredDescriptionDefault
fitNoDefault fill (exact width x height)
widthNoWidth (any to 16384) as a plain number, for example 10.
formatNopng, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types also work. Default: the same format as the input
heightNoHeight (any to 16384) as a plain number, for example 10.
qualityNo0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF, and palette PNG
animatedNoKeep every frame of an animated GIF/WebP. Default true
fileBase64YesThe input file as a base64 string, without a data: prefix.
stripMetadataNoRemove EXIF/GPS/colour-profile data. Default true
backgroundColorNoFill for transparent areas (always used for JPEG), e.g. '#ffffff' or 'white'
withoutEnlargementNotrue or false: without enlargement. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / fileBase64 / description
      Added value: +"The input file as a base64 string, without a data: prefix."
    • addedInput schema / properties / height / description
      Added value: +"Height (any to 16384) as a plain number, for example 10."
    • addedInput schema / properties / width / description
      Added value: +"Width (any to 16384) as a plain number, for example 10."
    • addedInput schema / properties / withoutEnlargement / description
      Added value: +"true or false: without enlargement. Default false."
  2. Changed11 schema fields changed
    • addedInput schema / properties / animated
      Added value: +{
      +  "description": "Keep every frame of an animated GIF/WebP. Default true",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / backgroundColor
      Added value: +{
      +  "description": "Fill for transparent areas (always used for JPEG), e.g. '#ffffff' or 'white'",
      +  "type": "string"
      +}
    • addedInput schema / properties / fit
      Added value: +{
      +  "description": "Default fill (exact width x height)",
      +  "enum": [
      +    "fill",
      +    "contain",
      +    "cover",
      +    "inside",
      +    "outside"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / format / description
      Added value: +"png, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types also work. Default: the same format as the input"
    • removedInput schema / properties / format / enum
      Removed value: -[
      -  "image/png",
      -  "image/jpeg"
      -]
    • addedInput schema / properties / height / maximum
      Added value: +16384
    • addedInput schema / properties / quality
      Added value: +{
      +  "description": "0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF, and palette PNG",
      +  "maximum": 100,
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / stripMetadata
      Added value: +{
      +  "description": "Remove EXIF/GPS/colour-profile data. Default true",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / width / maximum
      Added value: +16384
    • addedInput schema / properties / withoutEnlargement
      Added value: +{
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "fileBase64",
      -  "width",
      -  "height"
      -]New value: +[
      +  "fileBase64"
      +]
  3. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare the tool as read-only, idempotent, and non-destructive, so safety is largely covered. The description adds useful behavioral detail beyond that: supported input/output formats, preservation of GIF animation, aspect-ratio rules, and the fact that output is returned as two text items with base64 image data plus a JSON size note. It does not contradict the annotations; 'reads and writes' refers to image file formats, not server-state mutation.

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 the main purpose and then packs detailed fit-mode semantics into a compact space with no obvious filler. It is dense and somewhat run-on, but every clause supplies useful information for correct invocation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter image mutation tool with no output schema, the description covers the essential behavior: sizing rules, fit modes, enlargement control, format support, animation handling, and return structure. The schema already documents quality, metadata stripping, and individual field constraints, so the description is complete enough for an agent to call the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema description coverage is 100%, the description adds real semantic value beyond the schema by explaining that supplying only width or height preserves aspect ratio and by defining what each fit enum value actually does (fill, contain, cover, inside, outside). It also clarifies that withoutEnlargement prevents upscaling and that contain pads with backgroundColor.

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 states a specific verb and resource ('Resize an image') and immediately specifies the core sizing behavior, so an agent can tell it performs resizing rather than cropping or conversion. It does not explicitly name or contrast with sibling tools such as image_crop or image_convert, so it falls short of full sibling differentiation.

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?

It implies usage by explaining that width, height, or both are provided and that one dimension preserves aspect ratio. However, it gives no explicit when-to-use/when-not-to-use guidance or named alternatives for cases better served by image_crop, image_convert, or image_compress.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources