Skip to main content
Glama

Compress images

compress_images

Compress, convert or resize images. Send public image addresses in urls, uploads made with create_upload_link in upload_ids, or small files inline as base64 in files. Each image counts one against the account's daily images and compressions a minute, the same as on the website. Images are queued and compress in the background, usually in a few seconds: call get_image with each id until its status is completed, already-optimized, failed or cancelled, then download it from its download_url.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsNoPublic http or https addresses of images to fetch. Iminify refuses private networks, follows up to five redirects and names each file after its address.
filesNoSmall files sent inline, up to 4 MB each. Use create_upload_link for anything bigger.
levelNoHow hard to compress. "smart" (the default) finds the lowest quality that still looks like the original; "ultra" goes further and softens fine texture a little; "lossless" changes no pixel; "none" only converts, resizes and strips metadata.
scaleNoResize to this percentage of the original, 1 to 100. Not together with width or height.
widthNoResize to this width in pixels. Alone, the height follows the aspect ratio; with height too, the image is resized to exactly that size.
formatNoConvert to this format. "auto" encodes every format that can hold the image and keeps the smallest. Leave it out to keep each image's own format (a HEIC or TIFF always comes back in another one).
heightNoResize to this height in pixels, the same way as width.
upload_idsNoUpload ids from create_upload_link whose file has been sent. Each upload can be compressed once.
keep_metadataNoKeep the EXIF metadata (camera, date, location). Off by default, which strips it; the orientation is applied to the pixels first.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextNo
imagesNoThe images queued.
refusedNoThe sources refused, each with the reason.
not_startedNoAddresses not fetched because the call ran out of time.
not_started_noteNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "images": {
      +      "description": "The images queued.",
      +      "items": {
      +        "properties": {
      +          "created_at": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "hint": {
      +            "description": "What to do next, when the status alone does not say.",
      +            "type": "string"
      +          },
      +          "id": {
      +            "description": "The image's id.",
      +            "type": "string"
      +          },
      +          "name": {
      +            "description": "The name the optimized copy downloads under.",
      +            "type": "string"
      +          },
      +          "optimized": {
      +            "description": "Null until the image has finished.",
      +            "properties": {
      +              "download_url": {
      +                "description": "Works without a token for an hour.",
      +                "type": "string"
      +              },
      +              "format": {
      +                "type": "string"
      +              },
      +              "height": {
      +                "type": "integer"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "size": {
      +                "description": "Bytes.",
      +                "type": "integer"
      +              },
      +              "width": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "format",
      +              "size",
      +              "width",
      +              "height",
      +              "download_url"
      +            ],
      +            "type": [
      +              "object",
      +              "null"
      +            ]
      +          },
      +          "original": {
      +            "properties": {
      +              "download_url": {
      +                "description": "Works without a token for an hour.",
      +                "type": "string"
      +              },
      +              "format": {
      +                "type": "string"
      +              },
      +              "height": {
      +                "type": "integer"
      +              },
      +              "name": {
      +                "type": "string"
      +              },
      +              "size": {
      +                "description": "Bytes.",
      +                "type": "integer"
      +              },
      +              "width": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "name",
      +              "format",
      +              "size",
      +              "width",
      +              "height",
      +              "download_url"
      +            ],
      +            "type": "object"
      +          },
      +          "saved_bytes": {
      +            "description": "Negative when the optimized copy is larger.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "saved_percent": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "scan_id": {
      +            "description": "The page scan that found it, if one did.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "settings": {
      +            "properties": {
      +              "height": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "keep_metadata": {
      +                "type": "boolean"
      +              },
      +              "level": {
      +                "enum": [
      +                  "none",
      +                  "lossless",
      +                  "ultra",
      +                  "smart",
      +                  null
      +                ],
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "scale": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "width": {
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "level",
      +              "keep_metadata",
      +              "width",
      +              "height",
      +              "scale"
      +            ],
      +            "type": "object"
      +          },
      +          "share_url": {
      +            "description": "Its public page, once shared.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "status": {
      +            "enum": [
      +              "queued",
      +              "optimizing",
      +              "completed",
      +              "failed",
      +              "already-optimized",
      +              "cancelled"
      +            ],
      +            "type": "string"
      +          },
      +          "updated_at": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "status",
      +          "name",
      +          "original",
      +          "optimized",
      +          "saved_bytes",
      +          "saved_percent",
      +          "settings",
      +          "scan_id",
      +          "share_url",
      +          "created_at",
      +          "updated_at"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "next": {
      +      "type": "string"
      +    },
      +    "not_started": {
      +      "description": "Addresses not fetched because the call ran out of time.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "not_started_note": {
      +      "type": "string"
      +    },
      +    "refused": {
      +      "description": "The sources refused, each with the reason.",
      +      "items": {
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "retry_after": {
      +            "description": "Seconds to wait before sending it again.",
      +            "type": "integer"
      +          },
      +          "source": {
      +            "description": "The address, upload id or file name refused.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "source",
      +          "message",
      +          "code"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The description discloses queued background execution, typical latency, polling statuses, account quota effects, input network restrictions, and metadata handling. This goes well beyond the minimal readOnly/destructive/openWorld annotations and gives the agent an accurate model of the tool's side effects and async behavior.

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 four sentences, each earning its place: action, input channels, quota implications, and the asynchronous polling workflow. Key behavioral information is front-loaded, and there is no filler or redundant restatement of the schema.

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?

Given the nine optional parameters, rich parameter descriptions, existing output schema, and annotations, the description covers the full operation lifecycle: submit images, wait for terminal status, download results. It also addresses quotas and background behavior, so an agent can invoke and monitor the tool correctly.

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%, and each parameter is fully documented with enum meanings, size constraints, and interaction rules such as 'Not together with width or height.' The description itself only summarizes the input categories rather than adding deeper parameter meaning, so the baseline score applies.

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?

The opening phrase 'Compress, convert or resize images' names a specific processing action on image resources and clearly distinguishes this tool from sibling management tools like get_image, list_images, and delete_image. The description also conveys the asynchronous output model, making the tool's role unambiguous.

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

Usage Guidelines4/5

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

The description clearly explains three input channels (urls, upload_ids, files) and gives explicit workflow guidance: poll get_image until terminal statuses, then download from download_url. It does not explicitly exclude sibling tools or state when not to use this tool, but there is no sibling that competes with its compression function, so the context is sufficient.

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