Skip to main content
Glama

Compress a local image

abox_image_compress

Compresses local JPEG, PNG, or WebP images to a target byte size, optionally resizing or changing format, and saves a new file. Check fitted status since a target may be missed.

Instructions

Compress a still JPEG, PNG, or WebP to a target byte count using the existing abox.tools search and local browser codecs. Writes a new local file. Check fitted; a target can be missed. Already-small files pass through with metadata. Auto can adjust the output extension.

Input Schema

NameRequiredDescriptionDefault
formatNokeep
input_pathYesAbsolute local filesystem path. URLs and network shares are refused.
output_pathYesAbsolute local filesystem path. URLs and network shares are refused.
allow_resizeNo
target_bytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare it is a non-read-only, non-idempotent write; the description adds substantive behavior beyond that: it writes a new local file, the target can be missed so 'fitted' should be checked, small files pass through with metadata retained, and 'auto' may change the output extension. It omits overwrite semantics for an existing output_path, which matters for a non-idempotent writer.

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?

Four short sentences, front-loaded with purpose before caveats, with no filler. Some phrasing is overly telegraphic ('Check fitted'), which costs a little clarity for its brevity.

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?

For a file-writing tool with no output schema, the definition covers the main failure mode (missed target) but leaves return-value shape, overwrite behavior on output_path, and the effect of allow_resize unstated. Adequate but with visible gaps given the 5-parameter, mutation nature.

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 coverage is only 40%, so the description carries extra burden. It clarifies target_bytes ('target byte count'), the 'auto' value of format, and implicitly resizing, but says nothing about allow_resize or the 'keep'/'jpeg'/'png'/'webp' format choices, leaving half the parameters to the schema alone.

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?

States a specific verb (compress) plus the accepted resource types (JPEG, PNG, WebP) and the governing constraint (target byte count). It is clearly distinct from siblings like abox_pdf_split and abox_exif_remove, though it does not explicitly contrast with them.

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 description implies the use case (hit a byte budget) and adds caveats about misses and pass-through, but never states when to prefer this over e.g. abox_exif_remove or when it is inappropriate. Usage must be inferred from the target_bytes requirement.

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