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: 25 calls/day per IP. Paid: $0.003 per 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. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and open-world, so the safety baseline is covered. The description adds genuinely new behaviour: GPS/EXIF is stripped, files run on the provider's server and are deleted immediately with nothing stored, and there are per-IP rate limits with x402 payment — all material for an agent deciding to upload user data.

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?

A single dense paragraph that front-loads the core capability and then layers on side effects and pricing; almost every clause carries operational value. The closing pricing/x402 URL is the most promotional and least decision-relevant part, but it is short.

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?

No output schema, and the description compensates by stating the return content ('Size before/after per image'). Batch limits, data retention, format list, and cost model are all present; missing only quality-vs-level behaviour and edge cases like oversized or unsupported inputs.

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% with enum descriptions on level and format, so the baseline is 3. The description restates the level names and 2560px cap but adds no meaning beyond the schema — nothing about what 'strong' does to quality or size, or how the files array relates to the single fileName/fileContent pair in the example.

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?

Opens with a specific verb and resource ('Compress 1-30 images'), names supported input formats, and specifies the compression levels and optional output format/max-side behaviour. It is clearly distinct from pdf_compress, though it never acknowledges image_convert or image_resize even though format conversion and 2560px resizing overlap with those siblings.

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?

Gives useful operating context (batch size 1-30, free 25 calls/day per IP, paid $0.003/call via x402) that tells an agent whether it can afford to call it. It does not state when to prefer this over image_convert/image_resize for pure conversion or resizing, nor any exclusion such as unsupported formats or file-size caps, so routing still requires inference.

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