Skip to main content
Glama

photo_compress_to_size

Compress Image to Size — Compress an image to hit a target file size in KB. [category: photo]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesJPG, PNG, WebP, GIF, BMP, HEIC, HEIF
strip_exifNoStrip EXIF metadata from the output.
output_formatNoWhat to save it as. Leave blank to keep the format it came in as - except HEIC and HEIF pictures, which always come back as JPG. Squeezing to a size needs a format that compresses, which is why BMP and GIF are not offered.
target_size_kbYesTarget size in KB as a positive integer, e.g. 200. Field name is 'target_size_kb' — not 'target_size'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / output_format / x-ui / unset_label
      Previous value: -"Keeps input format"New value: +"Keeps input format (HEIC becomes JPG)"
  2. Changed1 schema field changed
    • addedInput schema / properties / output_format / x-ui
      Added value: +{
      +  "unset_label": "Keeps input format"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / target_size_kb / x-ui
      Added value: +{
      +  "unit": "KB"
      +}
  4. Changed4 schema fields changed
    • changedInput schema / properties / output_format / description
      Previous value: -"Optional output format, e.g. jpg, png, webp. HEIC/HEIF inputs default to jpg output."New value: +"What to save it as. Leave blank to keep the format it came in as - except HEIC and HEIF pictures, which always come back as JPG. Squeezing to a size needs a format that compresses, which is why BMP and GIF are not offered."
    • addedInput schema / properties / output_format / enum
      Added value: +[
      +  "jpg",
      +  "png",
      +  "webp"
      +]
    • addedInput schema / properties / target_size_kb / default
      Added value: +500
    • changedInput schema / properties / target_size_kb / maximum
      Previous value: -524288New value: +25600
  5. First observed

TDQS

B3.3/5.0
Behavior2/5

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

Annotations only provide readOnlyHint=false and destructiveHint=false, which don't disclose meaningful behavior, and the description adds no behavioral context beyond the basic purpose. It doesn't mention that target size may be approximate, that HEIC/HEIF always convert to JPG, or any side effects. The output_format schema notes are useful, but they are not part of the description itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence that front-loads the verb and objective. It contains no filler, and the [category: photo] tag is minimal, making it highly scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has moderate complexity and no output schema, yet the description doesn't state what is returned (e.g., a compressed file or the achieved size) or mention output behavior like HEIC-to-JPG conversion. Those details exist only in the parameter descriptions, so the tool-level definition is adequate but not comprehensive.

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 the schema fully documents all four parameters, including units, defaults, and format constraints. The description adds no parameter-level meaning, which matches the baseline score of 3 for full schema coverage.

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?

The description states a specific verb ('Compress') and a precise goal ('hit a target file size in KB'), which makes the tool's function clear. However, it doesn't explicitly differentiate this from the sibling photo_compress, so it stops short of full sibling-level clarity.

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?

The phrase 'to hit a target file size in KB' implies the main use case, so an agent can infer when to choose this tool. But there is no explicit guidance about when to prefer it over alternatives like photo_compress or pdf_compress, and no exclusions are stated.

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