Skip to main content
Glama

Compress image

image_compress
Read-onlyIdempotent

Compress image files by re-encoding at a chosen quality or target size, optionally resizing the longest side and converting between JPEG, WebP, AVIF, or PNG.

Instructions

Make an image file smaller: re-encode at a quality (default 80) and optionally cap the longest side (maxSide), as JPEG, WebP, AVIF or PNG ("keep" = same format; GIF/BMP/TIFF become PNG). Or give targetBytes to find the highest quality that fits that size. With keepSmaller (default on) the original is kept when re-encoding would not make it smaller. Reports before/after sizes and % saved. Transparent areas become white in JPEG. Metadata (EXIF, GPS) is not copied. PNG is lossless (quality ignored). Web version: https://s3eidat.github.io/image-squeeze/

Input Schema

NameRequiredDescriptionDefault
imageYesThe image: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI).
formatNoOutput format. Default keep (same as the input).keep
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).
maxSideNoScale down so the longest side is at most this many pixels (e.g. 1920).
qualityNoQuality 1-100 for JPEG / WebP / AVIF. Default 80 (website default).
keepSmallerNoKeep the original bytes when the result would be larger (same format and size only). Default true.
targetBytesNoAim for a file of at most this many bytes: searches the highest quality that fits (lossy formats only; overrides quality).
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.5/5.0
Behavior1/5

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

Annotations declare readOnlyHint=true, but the description says the tool writes a result to an output file path or folder and reports before/after sizes. Writing an output file is an environment modification, which contradicts the read-only annotation; despite otherwise rich behavioral detail, this forces a score of 1.

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 purpose is front-loaded and the description is dense with useful information. The trailing web URL is extra, and the single block is harder to scan than structured bullets, so it earns a 4 rather than a 5.

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 an eight-parameter tool with no output schema, the description covers modes, defaults, format edge cases, metadata handling, transparency behavior, and the result summary. This is complete enough for an agent to invoke it correctly.

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 adds useful cross-parameter semantics: targetBytes overrides quality, PNG ignores quality, keepSmaller preserves the original, JPEG transparency becomes white, and metadata is not copied. It still omits some parameter behavior, such as returnBase64 details, so it is not a 5.

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 action and resource: re-encode an image to make the file smaller, with quality, dimension, and target-size modes. It is clear, but it does not explicitly differentiate itself from sibling tools such as image_resize 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 Guidelines4/5

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

It gives clear usage contexts: reduce file size, optionally cap the longest side, or target a byte budget. It does not explicitly state when not to use it or direct the agent to image_resize/image_convert alternatives, so it falls short of a 5.

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