Skip to main content
Glama

MCP Compress

compress_file

Compress a file and return the result as base64. Pass fileBase64 + fileName. Choose EITHER a preset 'level' (light|balanced|maximum, default balanced) OR a 'custom' profile { imageQuality: 1-100, maxDimension?: px, convertFormat?: webp|avif|jpeg } -- supplying both is rejected. Supported families: images (PNG/JPG/WebP/AVIF), PDF (embedded JPEG images re-encoded, no AGPL tool), and Office OOXML (DOCX/PPTX/XLSX embedded media re-encoded). Returns fileBase64, bytesBefore, bytesAfter, gainPercent, mimeType and the output format. If compression would enlarge a non-converted file, the original is returned with 0% gain. WARNING: convertFormat 'avif' is CPU/RAM heavy (>= 1 GB RAM for large images). Max input size: 26214400 decoded bytes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNo
customNo
fileNameYes
fileBase64Yes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: mutual exclusivity of level/custom, the supported format families and how PDFs/OOXML are handled, the no-op guard that returns the original when compression would enlarge a file, an AVIF resource warning, and a hard 26214400-byte input cap.

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?

Front-loaded with the core action and the required inputs, then parameter selection, then supported families, then return fields and caveats. Dense but each sentence carries new information; the inline WARNING and trailing size cap make it slightly wall-of-text.

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?

No output schema exists, and the description compensates by naming every returned field (fileBase64, bytesBefore, bytesAfter, gainPercent, mimeType, output format). Together with the size limit, the format matrix, and the no-gain fallback, an agent has everything needed to call this correctly.

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?

Schema description coverage is 0%, so the description must compensate, and it largely does: it names the three preset levels with the default (balanced), enumerates custom fields with units and ranges, and states both required inputs. It never explains what fileName is actually used for (e.g. extension-based format detection).

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?

Opens with a specific verb+resource and states the output form: 'Compress a file and return the result as base64.' The supported-family list further pins down what it operates on. It doesn't name the siblings (estimate_compression, list_compression_profiles), so differentiation is inferred rather than stated.

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?

Gives an explicit parameter-selection rule — choose EITHER a preset level OR a custom profile, since supplying both is rejected — which is the key usage decision an agent faces. It still offers no guidance on when to call this versus estimate_compression or list_compression_profiles.

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