Skip to main content
Glama

Compress image

compress_image

Reduce image file size without changing format. Re-encode JPG, WebP, or AVIF at a set quality, or losslessly recompress PNG to shrink file size.

Instructions

Smaller file, same format. jpg/webp/avif re-encode at quality (default 80, mozjpeg for jpg); png is recompressed losslessly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
outputNoOutput file path. Default: next to the input, with a suffix and the right extension.
previewNoAttach a small JPEG preview to the result (default true).
qualityNoLossy quality 1-100 (default 80). Ignored for png.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the behavioral disclosure burden. It reveals real operational behavior: lossy re-encoding at a quality level (with mozjpeg for jpg) versus lossless recompression for png. It does not mention overwrite behavior or the preview attachment side effect, but the core behavior is transparent.

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?

Two short sentences carry all the essential information, with the main outcome front-loaded. There is no repeated schema content and every clause earns its place.

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

Completeness4/5

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

For a four-parameter tool with no output schema and no annotations, the description plus schema covers the key invocation needs: formats, quality semantics, output default, and preview. It lacks explicit safety/destructive context and a concrete statement of the input parameter's accepted form, but these are minor given the overall clarity.

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?

The schema documents output, preview, and quality, but the required input parameter has no schema description. The description adds meaningful format-dependent semantics to quality (default 80, mozjpeg for jpg, ignored for png), which is not present in the schema. It could further clarify what input accepts, but it partially compensates for the missing input description.

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 description begins with a precise outcome ('Smaller file, same format') and specifies different behavior for jpg/webp/avif versus png. This makes the tool's purpose unmistakable and distinguishes it from siblings like convert_image, resize_image, and crop_image.

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?

Usage context is implied: use it when you need a smaller file in the same format rather than converting, resizing, or cropping. However, there is no explicit when-to-use/when-not-to-use guidance and no named alternatives, so the agent must infer the boundary from sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.