Skip to main content
Glama

image_compress

Idempotent

imagepeek: Compress an image, optionally to a byte budget. To change the format only use image_convert. Returns a smaller image or unchanged original, metadata included (returned_original). require_smaller=true: uncharged 422 no_smaller_output. Re-encoding strips EXIF/GPS/XMP/IPTC. Input caps: 10 MB, 40 MP. Output caps: 15 MB, 50 MP. 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

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "image_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
fitNoNeeds max_bytes. quality keeps size; downscale tries up to 6 smaller same-ratio sizes in one time budget. Downscale needs quality >=10 if set. Check target_met; fit is not guaranteed.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 palette size.
formatNoOutput format; defaults to input.
outputNobase64 (default): inline. url: stored for 24 hours; link, metadata.base64
qualityNoTarget quality, or ceiling with max_bytes.
keep_iccNoKeep ICC colour profile.
losslessNoLossless WebP.
min_sideNoDownscale only: shortest side floor in px. Never enlarges; smaller inputs keep size.
max_bytesNoTry highest quality that fits.
auto_orientNoApply the EXIF orientation first.
progressiveNoProgressive JPEG.
image_base64NoThe image as standard or url-safe base64 (at most 10 MB decoded; a data:image/...;base64, prefix is fine); or use url.
require_smallerNoReject original fallback: 422 no_smaller_output.

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_factorNo
downscale_stepsNo
returned_originalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / colors / description
      Previous value: -"png: quantise to this many colours."New value: +"PNG palette size."
    • changedInput schema / properties / fit / description
      Previous value: -"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."New value: +"Needs max_bytes. quality keeps size; downscale tries up to 6 smaller same-ratio sizes in one time budget. Downscale needs quality >=10 if set. Check target_met; fit is not guaranteed."
    • changedInput schema / properties / format / description
      Previous value: -"Output format: jpeg, png, webp or avif (default: the input's)."New value: +"Output format; defaults to input."
    • changedInput schema / properties / keep_icc / description
      Previous value: -"Keep the ICC colour profile."New value: +"Keep ICC colour profile."
    • changedInput schema / properties / lossless / description
      Previous value: -"webp only: lossless encoding."New value: +"Lossless WebP."
    • changedInput schema / properties / max_bytes / description
      Previous value: -"Size target: the highest quality that fits."New value: +"Try highest quality that fits."
    • changedInput schema / properties / min_side / description
      Previous value: -"downscale only: shortest-side floor in pixels. Inputs already below this floor are not resized; never upscales."New value: +"Downscale only: shortest side floor in px. Never enlarges; smaller inputs keep size."
    • changedInput schema / properties / progressive / description
      Previous value: -"jpeg only: progressive encoding."New value: +"Progressive JPEG."
    • changedInput schema / properties / quality / description
      Previous value: -"Target (or, with max_bytes, highest) quality."New value: +"Target quality, or ceiling with max_bytes."
    • changedInput schema / properties / require_smaller / description
      Previous value: -"Refuse the original-file fallback with 422 no_smaller_output."New value: +"Reject original fallback: 422 no_smaller_output."
  2. Changed1 schema field changed
    • addedInput schema / properties / require_smaller
      Added value: +{
      +  "default": false,
      +  "description": "Refuse the original-file fallback with 422 no_smaller_output.",
      +  "type": "boolean"
      +}
  3. Changed34 schema fields changed
    • changedInput schema / properties / auto_orient / description
      Previous value: -"Apply the EXIF orientation first (default true)."New value: +"Apply the EXIF orientation first."
    • removedInput schema / properties / auto_orient / title
      Removed value: -"Auto Orient"
    • removedInput schema / properties / colors / default
      Removed value: -null
    • removedInput schema / properties / colors / title
      Removed value: -"Colors"
    • removedInput schema / properties / fit / title
      Removed value: -"Fit"
    • removedInput schema / properties / format / default
      Removed value: -null
    • removedInput schema / properties / format / title
      Removed value: -"Format"
    • removedInput schema / properties / image_base64 / default
      Removed value: -null
    • removedInput schema / properties / image_base64 / title
      Removed value: -"Image Base64"
    • changedInput schema / properties / keep_icc / description
      Previous value: -"Keep the ICC colour profile (default true)."New value: +"Keep the ICC colour profile."
    • removedInput schema / properties / keep_icc / title
      Removed value: -"Keep Icc"
    • changedInput schema / properties / lossless / description
      Previous value: -"webp only: lossless encoding (default false)."New value: +"webp only: lossless encoding."
    • removedInput schema / properties / lossless / title
      Removed value: -"Lossless"
    • removedInput schema / properties / max_bytes / default
      Removed value: -null
    • removedInput schema / properties / max_bytes / title
      Removed value: -"Max Bytes"
    • changedInput schema / properties / min_side / description
      Previous value: -"downscale only: shortest-side floor in pixels (1-32768, default 256). Inputs already below this floor are not resized; never upscales."New value: +"downscale only: shortest-side floor in pixels. Inputs already below this floor are not resized; never upscales."
    • removedInput schema / properties / min_side / title
      Removed value: -"Min Side"
    • removedInput schema / properties / output / title
      Removed value: -"Output"
    • changedInput schema / properties / progressive / description
      Previous value: -"jpeg only: progressive encoding (default false)."New value: +"jpeg only: progressive encoding."
    • removedInput schema / properties / progressive / title
      Removed value: -"Progressive"
    • removedInput schema / properties / quality / default
      Removed value: -null
    • removedInput schema / properties / quality / title
      Removed value: -"Quality"
    • removedInput schema / properties / url / default
      Removed value: -null
    • removedInput schema / properties / url / title
      Removed value: -"Url"
    • removedInput schema / title
      Removed value: -"image_compressArguments"
    • removedOutput schema / properties / bytes / description
      Removed value: -"Bytes."
    • removedOutput schema / properties / content_type / description
      Removed value: -"MIME type."
    • removedOutput schema / properties / downscale_steps / description
      Removed value: -"downscale only: smaller sizes searched (0-6)."
    • removedOutput schema / properties / expires_at / description
      Removed value: -"UTC expiry."
    • removedOutput schema / properties / input / properties
      Removed value: -{
      -  "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"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / notes / items
      Removed value: -{
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / scale_factor / description
      Removed value: -"downscale only: uniform scale relative to the EXIF-oriented input, before rounding dimensions; 1 for an unchanged original."
    • removedOutput schema / properties / sha256 / description
      Removed value: -"SHA-256."
    • removedOutput schema / properties / url / description
      Removed value: -"Public link."
  4. 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."
  5. 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"
      +  ]
      +}
  6. 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"
      +  ]
      +}
  7. 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"
      +}
  8. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false, idempotentHint=true, destructiveHint=false and openWorldHint=true, so safety is largely covered. The description still adds genuinely non-obvious behavior: re-encoding strips EXIF/GPS/XMP/IPTC, images are not logged, and url output persists for 24 h. That is useful, though it is delivered as a dense telegraphic block rather than structured caveats.

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 purpose and the sibling routing rule, then caps, errors, privacy, latency, price and docs in a compact sequence. No sentence is filler, but the fragment-heavy style ('Re-encoding strips EXIF/GPS/XMP/IPTC. Input caps: 10 MB, 40 MP.') packs many distinct facts into one paragraph, which costs some scannability.

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 14-parameter tool with an output schema, this covers what the schema cannot: input/output caps, latency, cost, free-tier quota, privacy/retention, error semantics and the stripped-metadata side effect. Return values are covered by the output schema and only the notable `returned_original` flag is called out, which is the right division of labor.

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; the description still adds meaning beyond the schema by tying require_smaller to an 'uncharged' 422 and by framing output=url as a 24 h retention choice. It does not add much for the many boolean flags (progressive, auto_orient, keep_icc), which rely on the schema text alone.

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+resource ('Compress an image, optionally to a byte budget') and immediately distinguishes the nearest sibling: 'To change the format only use image_convert.' An agent can route between image_compress and image_convert without opening either schema.

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 when-not ('format only' → image_convert) plus conditional guidance on the two competing modes: fit=quality vs downscale, and require_smaller=true producing an uncharged 422. It also names the free-tier limit (3 calls per IP per UTC day) and price, which affects whether an agent should call it at all.

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