Skip to main content
Glama

Compress PDF

pdf_compress
Read-onlyIdempotent

Shrink PDFs by re-rendering each page as a JPEG, ideal for scans and photo-heavy files. Choose email, balanced or high presets, or set DPI and quality, and see before/after size.

Instructions

Shrink a PDF by re-rendering every page as a JPEG image (best for scans and photo-heavy files). Presets like the website: email (96 DPI, quality 55), balanced (144 DPI, 72), high (220 DPI, 85); or set dpi/quality yourself; optional grayscale. The result loses selectable text, links and form fields. Reports before/after size and a verdict ("bigger" means keep the original: the PDF was already efficient). Web version: https://s3eidat.github.io/pdf-compress/

Input Schema

NameRequiredDescriptionDefault
dpiNoOverride the preset resolution (36-300 DPI).
fileYesThe PDF: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI).
outputNoWhere to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set).
presetNoQuality preset. Default "balanced".balanced
qualityNoOverride the preset JPEG quality (30-95).
passwordNoPassword, if the PDF is protected.
grayscaleNoConvert pages to grayscale.
returnBase64NoAlso return the output as base64 in the result (only for small files). Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior1/5

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

The description discloses useful behavioral details such as JPEG re-rendering, loss of selectable text/links/forms, and size verdict reporting. However, annotations declare readOnlyHint=true while the tool produces a compressed output file, which is a write side effect; this directly contradicts the read-only annotation.

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 front-loaded with purpose and best-fit use case, then quickly covers presets, caveats and output reporting. It is dense but efficient, with no wasted sentences.

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?

For an 8-parameter tool with no output schema, the description covers the transformation method, case-specific suitability, lossy effects, preset behavior, and the shape of the result. Remaining parameter details are fully covered by the schema.

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 coverage is 100%, so the schema already documents all parameters. The description still adds value by mapping presets to concrete DPI/quality values and explaining grayscale and custom dpi/quality overrides, going beyond the schema's enum labels.

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 states a specific verb and resource (shrink/compress a PDF) and explains the mechanism (re-rendering pages as JPEG). It also distinguishes the best-fit cases (scans and photo-heavy files), making the tool easy to tell apart from PDF manipulation siblings.

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?

It gives clear usage context with "best for scans and photo-heavy files" and explains preset tradeoffs. It does not explicitly name alternatives for text-heavy PDFs, but the warning about losing selectable text, links and form fields effectively signals when not to use it.

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

Deploy Server

Other Tools