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): inline. url: stored for 24 hours; link, metadata.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
urlNoPublic link.
bytesNoBytes.
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
inputNo
notesNo
widthNo
formatNo
heightNo
sha256NoSHA-256.
sourceNo
encodesNo
final_urlNo
operationNo
expires_atNoUTC expiry.
source_urlNo
target_metNo
after_bytesNo
data_base64No
saved_bytesNo
saved_ratioNo
before_bytesNo
content_typeNoMIME type.
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. Changed6 schema fields changed
    • changedInput schema / properties / output / description
      Previous value: -"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."New value: +"base64 (default): inline. url: stored for 24 hours; link, metadata."
    • addedOutput schema / properties / bytes / description
      Added value: +"Bytes."
    • addedOutput schema / properties / content_type / description
      Added value: +"MIME type."
    • addedOutput schema / properties / expires_at / description
      Added value: +"UTC expiry."
    • addedOutput schema / properties / sha256 / description
      Added value: +"SHA-256."
    • addedOutput schema / properties / url / description
      Added value: +"Public link."
  2. 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"
      +  ]
      +}
  3. 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"
      +  ]
      +}
  4. 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"
      +}
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Far exceeds the annotations, which only say this is a non-destructive, idempotent, open-world call. It discloses metadata stripping (EXIF/GPS/XMP/IPTC), the 413 thresholds and that refused requests are not charged, the 24 h retention only when output=url, no logging, latency, price, and a free tier of 3 calls per IP per UTC day.

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 the sibling hand-off, then structured into paragraphs for fitting, format/limit details, and output/billing. The middle paragraph is a semicolon-chained run-on that takes effort to parse, though every clause carries real information.

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 an output schema present the description needn't re-document return values, and it still names the key fields (data_base64, target_met, url retention). Combined with 13 fully documented parameters, annotations, and pricing/limit details, nothing an agent needs in order to call this correctly is missing.

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, but the description adds cross-parameter meaning the schema cannot express: max_bytes interacts with fit, downscale searches up to 6 aspect-preserving sizes at quality >=10 with min_side 256 under a single time budget, and never upscales. It also tells the agent to inspect target_met, which is a semantic the schema does not convey.

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 optional byte-budget dimension, which no sibling exposes. It also explicitly names image_convert as the tool for format-only work, so the boundary with the closest sibling is unambiguous.

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?

Gives an explicit alternative and the condition that selects it ("To change the format only use image_convert"), then spells out the choice between fit: quality and fit: downscale with their defaults and constraints. It also states refusal conditions (unsupported formats, >40 MP) up front so the agent can pre-check 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