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 €15/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)}] (up to 60 files, 20 MB total)
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; 20 MB total decoded limit per call)
maxSide2560NoAlso shrink to max 2560 px

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / fileContent / description
      Previous value: -"The file as base64 (a data: URI is fine)"New value: +"The file as base64 (a data: URI is fine; 20 MB total decoded limit per call)"
    • changedInput schema / properties / files / description
      Previous value: -"Or several files: [{fileName, fileContent (base64)}]"New value: +"Or several files: [{fileName, fileContent (base64)}] (up to 60 files, 20 MB total)"
    • addedInput schema / properties / files / maxItems
      Added value: +60
  2. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/idempotentHint annotations: metadata is stripped (GPS/EXIF removed), the response includes size before/after per image, processing happens server-side with files deleted immediately and nothing stored. It also discloses the two auth/payment paths (X-API-Key vs x402 per-call) and the free-tier rate limit, which 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 scope, then privacy, then pricing/auth — a sensible ordering with little filler. It is a dense run-on paragraph with long URLs, which slightly hurts scanability but not correctness.

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?

With no output schema, the description still tells the agent what comes back (size before/after per image) and covers privacy, auth, and cost — everything needed to call it correctly. The only loose end is the batch-count mismatch with the schema.

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; the description restates the level values and the 2560 px meaning without adding syntax or defaults beyond the schema. It also introduces a discrepancy: the description says 1-30 images while the schema allows up to 60 files, which could mislead on batch limits.

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?

States a specific verb and resource (compress images) plus scope (1-30 images, JPG/PNG/WebP/HEIC), the three compression levels, optional format conversion and maxSide2560. An agent can tell this apart from a pure converter such as image_convert because compression is the primary action and conversion is explicitly optional.

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 through the batch range and the free-tier quota (5 calls/day per IP), which tells an agent when this is viable, but there is no explicit when-to-use versus when-to-pick-a-sibling guidance (e.g. versus image_convert or pdf_compress for non-image inputs).

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