Skip to main content
Glama

Image Resize

image_resize

Download an image from a URL and resize it with libvips (sharp): set width and/or height, fit mode (inside keeps aspect ratio within the box, cover crops to fill, contain letterboxes, fill stretches), output format (PNG, JPEG, WebP, AVIF) and quality. Honors EXIF rotation. Input up to 15 MB / 50 megapixels, output up to 4096px per side. Returns a short-lived download URL (valid 1 hour) with final dimensions and byte size; set includeBase64 for the bytes inline (up to 3 MB). Deterministic, no AI.

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

Input Schema

NameRequiredDescriptionDefault
fitNoHow to fit both dimensions (default inside = keep aspect ratio, no crop)
urlYesPublic URL of the source image (PNG, JPEG, WebP, AVIF, GIF, TIFF, SVG)
widthNoTarget width in pixels, 1-4096 (give width, height, or both)
formatNoOutput format (default: same family as the source, PNG otherwise)
heightNoTarget height in pixels, 1-4096
qualityNoJPEG/WebP/AVIF quality 1-100 (default 82)
backgroundNoHex color for contain padding / JPEG flattening, e.g. #ffffff (default white)
includeBase64NoAlso return the image as base64 in the response (default false; omitted if over 3 MB)
withoutEnlargementNoNever upscale a smaller source (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations: input caps (15 MB / 50 MP), output cap (4096px per side), the 1-hour expiry of the returned URL, the 3 MB ceiling that silently drops includeBase64, EXIF rotation handling, and the explicit 'Deterministic, no AI' statement. These are exactly the operational constraints an agent needs before committing a call.

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 but front-loaded: the operation comes first, then capabilities, then limits, then the return value. Parenthetical explanations are compact rather than padded, though the single run-on block could be split to make the limits and return contract easier to scan.

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 9-parameter, no-output-schema tool, the description covers the return shape (short-lived URL plus final dimensions and byte size, or inline base64), the failure boundaries (size/megapixel caps), and the supported input formats. An agent has enough to call it correctly without probing.

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

Parameters4/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; the description earns an extra point by spelling out the semantics of each fit mode (inside/cover/contain/fill) and tying background padding to 'contain' and JPEG flattening, which the one-line schema entries only partially convey.

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+resource: 'Download an image from a URL and resize it with libvips (sharp)', and immediately enumerates the controllable dimensions (width/height, fit mode, format, quality). Nothing in the sibling list overlaps with image resizing, so an agent can route here unambiguously.

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 is implied by the operation itself (fetch a remote image and produce a resized variant), and limits make the applicable domain clear. But there is no explicit when-to-use / when-not-to-use guidance, and no named alternative for cases like local file input or formats outside the supported set.

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.