Skip to main content
Glama

compress

Re-encode an image to a new file at a chosen quality to reduce file size, returning bytes before/after and percent saved.

Instructions

Re-encode an image at a chosen quality to reduce file size, writing the result to a NEW file (source unchanged). Quality is 1-100 (default 80); lower values produce smaller files. The output format defaults to JPEG but can be set via 'format'. Returns the output path plus bytes_before, bytes_after, and saved_percent so you can see how much space was recovered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
outYesOutput image path. A new file is created; the source is left untouched.
pathYesSource image path.
formatNoOptional output format (defaults to JPEG). Use PNG/WEBP to keep transparency.
qualityNoQuality 1-100 (higher = larger, better). Default 80.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries full responsibility. It discloses the side-effect (new file, source untouched), the quality/format behavior, and the return payload (output path plus size metrics). This goes well beyond what a bare schema would convey and fully informs the agent of operational consequences.

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 sentences, no fluff. The most critical information (source unchanged, new file) is front-loaded, and the rest is packed efficiently. Every clause earns its place.

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 no output schema, the description appropriately details the return values (output path, bytes_before/after, saved_percent). It also covers defaults for quality and format, making the tool fully callable without extra research.

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?

Though schema coverage is 100%, the description adds meaningful semantics: quality scale (1-100) and its effect on file size, default format (JPEG) and the transparency hint for PNG/WEBP. This exceeds the schema's generic parameter descriptions and helps the agent choose appropriate values.

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?

Clearly states the verb 're-encode' with the resource 'image', the purpose 'reduce file size', and a key differentiator: writes to a NEW file, preserving the source. This distinguishes it from siblings like convert, resize, or rotate without needing to inspect their schemas.

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 explicitly ties use to reducing file size and explains the quality/format behavior. It does not explicitly contrast with alternatives (e.g., when to use compress vs convert), but the purpose is clear enough for an agent to infer appropriate usage. Minor gap: no explicit 'use when' or 'use instead' guidance.

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