Skip to main content
Glama

compress_image

Reduce image file size by compressing and optionally resizing images to specified dimensions. Supports JPEG, WebP, and PNG formats for optimized storage and faster loading.

Instructions

Compress an image to reduce file size.

Optionally resize to max dimensions while compressing. Works best with JPEG and WebP. PNG files will be converted to optimized PNG.

Args: path: Absolute path to the image file. quality: Compression quality (1-100, lower = smaller file). Default 60. max_width: Optional maximum width. Image will be downscaled if wider. max_height: Optional maximum height. Image will be downscaled if taller. output_path: Where to save. Defaults to _compressed..

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
qualityNo
max_widthNo
max_heightNo
output_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adequately describes the core behavior (compression with optional resizing) and format handling, but lacks details about permissions needed, whether the operation is destructive to the original file, error conditions, or performance characteristics. The description doesn't contradict any annotations since none exist.

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 efficiently structured with a clear purpose statement followed by a well-organized parameter section. Every sentence earns its place by providing essential information without redundancy. The formatting with bullet-like parameter explanations enhances readability while maintaining brevity.

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?

Given the tool's moderate complexity (5 parameters, mutation operation), no annotations, but with an output schema present, the description is mostly complete. It covers the core functionality and parameters well, and the output schema presumably handles return values. However, for a mutation tool with no annotations, it could benefit from more behavioral context about side effects or error handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing clear semantics for all 5 parameters. Each parameter is explained with its purpose, constraints (e.g., '1-100' for quality), default values, and behavioral effects (e.g., 'Image will be downscaled if wider'). This adds significant value beyond the bare schema.

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 clearly states the tool's purpose with a specific verb ('compress') and resource ('image'), and distinguishes it from siblings by focusing on file size reduction rather than format conversion (convert_image), resizing (resize_image), or metadata removal (strip_metadata). The first sentence directly answers 'what does this tool do?'

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 provides clear context about when to use this tool ('Works best with JPEG and WebP. PNG files will be converted to optimized PNG'), which helps differentiate it from format-focused siblings like convert_image. However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the siblings, such as when resize_image might be more appropriate for pure resizing without compression.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Adityaaery20/media-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server