Skip to main content
Glama

imagepeek: compress an image (optionally to a byte budget)

image_compress
Idempotent

imagepeek: Compress an image, optionally to a byte budget. To change the format only use image_convert. Returns a smaller JPEG, WebP, AVIF or PNG (or original if not smaller). With max_bytes, default fit: quality keeps dimensions; fit: downscale tries up to 6 aspect-preserving reductions, quality >=10, min_side=256, never upscales, one time budget. Check target_met. Reads PNG, JPEG, WebP, GIF, TIFF, BMP, ICO and AVIF; other formats and images over 40 megapixels are refused (not charged). Output: base64 data_base64, without EXIF, GPS, XMP or IPTC; over 15 MB or 50 megapixels is a 413 (not charged). Images are not logged; a result is kept only with output "url" (24 h). Typically 0.5-2 s. Price: USD 0.003. Free: 3 imagepeek calls per IP per UTC day. Docs: https://tanod.dev/learn/image-compress-api.html

Input Schema

NameRequiredDescriptionDefault
fitNoRequires max_bytes when supplied. quality (default) keeps dimensions; downscale tries up to 6 smaller sizes with the same aspect ratio, searching quality >= 10 at each size under one time budget. Check target_met; fitting is not guaranteed. Downscale requires quality >= 10 if set.quality
urlNoPublic http(s) URL of the image (at most 10 MB; private, internal and IP-literal hosts are refused); or use image_base64.
colorsNopng: quantise to this many colours.
formatNoOutput format: jpeg, png, webp or avif (default: the input's).
outputNobase64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window.base64
qualityNoTarget (or, with max_bytes, highest) quality.
keep_iccNoKeep the ICC colour profile (default true).
losslessNowebp only: lossless encoding (default false).
min_sideNodownscale only: shortest-side floor in pixels (1-32768, default 256). Inputs already below this floor are not resized; never upscales.
max_bytesNoSize target: the highest quality that fits.
auto_orientNoApply the EXIF orientation first (default true).
progressiveNojpeg only: progressive encoding (default false).
image_base64NoThe image as standard or url-safe base64 (at most 10 MB decoded; a data:image/...;base64, prefix is fine); or use url.

Output Schema

NameRequiredDescriptionDefault
urlNo
bytesNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
inputNo
notesNo
widthNo
formatNo
heightNo
sha256No
sourceNo
encodesNo
final_urlNo
operationNo
expires_atNo
source_urlNo
target_metNo
after_bytesNo
data_base64No
saved_bytesNo
saved_ratioNo
before_bytesNo
content_typeNo
quality_usedNo
scale_factorNodownscale only: uniform scale relative to the EXIF-oriented input, before rounding dimensions; 1 for an unchanged original.
downscale_stepsNodownscale only: smaller sizes searched (0-6).
returned_originalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / fit
      Added value: +{
      +  "default": "quality",
      +  "description": "Requires max_bytes when supplied. quality (default) keeps dimensions; downscale tries up to 6 smaller sizes with the same aspect ratio, searching quality >= 10 at each size under one time budget. Check target_met; fitting is not guaranteed. Downscale requires quality >= 10 if set.",
      +  "enum": [
      +    "quality",
      +    "downscale"
      +  ],
      +  "title": "Fit",
      +  "type": "string"
      +}
    • addedInput schema / properties / min_side
      Added value: +{
      +  "default": 256,
      +  "description": "downscale only: shortest-side floor in pixels (1-32768, default 256). Inputs already below this floor are not resized; never upscales.",
      +  "maximum": 32768,
      +  "minimum": 1,
      +  "title": "Min Side",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / downscale_steps
      Added value: +{
      +  "description": "downscale only: smaller sizes searched (0-6).",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / scale_factor
      Added value: +{
      +  "description": "downscale only: uniform scale relative to the EXIF-oriented input, before rounding dimensions; 1 for an unchanged original.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / output
      Added value: +{
      +  "default": "base64",
      +  "description": "base64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window.",
      +  "enum": [
      +    "base64",
      +    "url"
      +  ],
      +  "title": "Output",
      +  "type": "string"
      +}
    • addedOutput schema / properties / expires_at
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / sha256
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / url
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  3. Changed7 schema fields changed
    • addedInput schema / properties / auto_orient / description
      Added value: +"Apply the EXIF orientation first (default true)."
    • addedInput schema / properties / format / description
      Added value: +"Output format: jpeg, png, webp or avif (default: the input's)."
    • addedInput schema / properties / keep_icc / description
      Added value: +"Keep the ICC colour profile (default true)."
    • addedInput schema / properties / lossless / description
      Added value: +"webp only: lossless encoding (default false)."
    • addedInput schema / properties / progressive / description
      Added value: +"jpeg only: progressive encoding (default false)."
    • changedInput schema / properties / url / description
      Previous value: -"Public http(s) URL of the image (at most 10 MB); or use image_base64."New value: +"Public http(s) URL of the image (at most 10 MB; private, internal and IP-literal hosts are refused); or use image_base64."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "after_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "before_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "content_type": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "data_base64": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "encodes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "final_url": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "format": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "height": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "input": {
      +      "properties": {
      +        "animated": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "bytes": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "format": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "frames": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "has_alpha": {
      +          "type": [
      +            "boolean",
      +            "null"
      +          ]
      +        },
      +        "height": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        },
      +        "width": {
      +          "type": [
      +            "integer",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "notes": {
      +      "items": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "operation": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "quality_used": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "returned_original": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "saved_bytes": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "saved_ratio": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "source_url": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "target_met": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "width": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, idempotentHint=true) by disclosing refusal conditions (>40 MP, unsupported formats), metadata stripping (EXIF/GPS/XMP/IPTC), a 413 ceiling at 15 MB or 50 MP, that oversized inputs are not charged, privacy (images not logged), 24 h retention only for `output: url`, latency, price and a free tier. These are exactly the operational facts an agent needs before invoking a billed, network-dependent tool.

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-loads purpose and the sibling routing before the operational detail, and sentences are densely informative. It is long and slightly cluttered by pricing/docs/free-tier text mid-paragraph, but almost every sentence carries a decision-relevant fact.

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 13-parameter, billed, open-world image transform, it covers inputs, supported formats, refusal paths, output shape, retention and cost. An output schema exists, so return structure needn't be spelled out, and the `target_met` and `data_base64` mentions are bonus rather than obligation.

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 description coverage is 100%, so every one of the 13 parameters is already documented; the description only reiterates the `fit`, `min_side`, quality floor and `output` behavior. The one genuine addition is pointing at the `target_met` result field, which the schema does not carry. Baseline 3 is appropriate since the schema does the heavy lifting.

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 an image') plus the key scope modifier ('optionally to a byte budget'), and explicitly routes format-only work to the sibling image_convert. An agent can distinguish it from image_convert, image_resize and image_thumbnail from the description alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Names the alternative (image_convert) with the triggering condition ('to change the format only'), and explains the two modes: default `fit: quality` keeps dimensions, `fit: downscale` performs aspect-preserving reductions. It also notes checking `target_met` because fitting is not guaranteed, so the agent knows the outcome is conditional.

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