Skip to main content
Glama

Image Compression API - smaller JPG, PNG, WebP

image_compress
Read-onlyIdempotent

Compress 1-30 images (JPG, PNG, WebP, HEIC...) at level strong / medium / light, optionally to another format and max side 2560 px. GPS/EXIF removed. Size before/after per image. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.003/call via x402 at https://radarbg.com/x402/image-compress.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "level": "medium",
      "fileName": "sample.png",
      "fileContent": "iVBORw0KGgoAAAANSUhEUgAAAHgAAABQCAIAAABd+SbeAAAA6klEQVR4nO3cQQ2DABAAwdKgg1cFVQIykIOEyqiIisFDKdsQZv6XXDb3vmFa3jeOd//3AlchdEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6Mi4Z/jznH+0xmk8Xut3gy46InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ROiJ0ROiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNARoSNCR4SOCB0ZPIFtuOiI0BGhI0JHhI4IHRE6InRE6IjQEaEjQkeEjggdEToidEToiNCRDexBBl0OjJSaAAAAAElFTkSuQmCC"
    },
    "name": "image_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoOr several files: [{fileName, fileContent (base64)}]
levelNostrong, medium or lightmedium
formatNosame, jpg, png or webpsame
fileNameNoFile name with extension, e.g. report.pdf
fileContentNoThe file as base64 (a data: URI is fine)
maxSide2560NoAlso shrink to max 2560 px

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/openWorld annotations: it discloses that GPS/EXIF metadata is stripped, that processing happens server-side with files deleted immediately and nothing stored, that the response includes before/after sizes per image, and it spells out both auth paths (Radar API key in X-API-Key, or x402 per-call payment). These are exactly the operational facts an agent needs before invoking.

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?

Front-loaded with the core action and constraints, then behavior, privacy, and finally pricing/auth, so an agent can stop reading early. The pricing URL and per-call cost sentence is the only mildly promotional part, but it doubles as authentication guidance.

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 tool with no output schema, the description covers what comes back (per-image before/after size), privacy guarantees, rate limits, and both auth mechanisms, which is close to complete. Minor gaps remain around error behavior (e.g. per-file failures in a batch) and what the file objects look like on return.

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 schema already documents every parameter; the description still adds meaning by stating the 1-30 file batch ceiling, clarifying maxSide2560 means a 2560 px cap, and noting HEIC input is accepted even though the format enum only lists jpg/png/webp. That extra constraint and accepted-input information is genuinely beyond 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?

States a specific verb and resource (compress images), plus scope details: batch of 1-30, accepted formats (JPG, PNG, WebP, HEIC), compression levels, optional output format, and max side 2560 px. It does not explicitly route away from overlapping siblings like image_convert, image_resize, or image_remove_exif, which it partially duplicates, so it falls short of a 5.

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 feature list (shrink files, optionally reformat, optionally cap dimension) and the free-tier quota of 5 calls/day hints at cost-aware use, but there is no explicit when-to-use/when-not statement or named alternative for pure format conversion, resizing, or EXIF stripping, all of which exist as siblings.

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