Skip to main content
Glama

pdf_compress

Compress PDF — Reduce PDF file size while preserving readability. Quality presets: light (300 DPI), balanced (150 DPI, default), mobile (96 DPI), maximum (72 DPI). Also supports metadata-only stripping and a target-size mode. [category: pdf]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPDF to compress
qualityNoHow hard to squeeze. Light keeps print quality (300 DPI); balanced is the everyday choice (150 DPI); mobile (96 DPI) and maximum (72 DPI) trade sharpness for size.balanced
targetSizeNoSqueeze until the file fits this size. Overrides the preset above.
metadataOnlyNoOnly strip the hidden details - author, title, producing software - and leave every page exactly as it is.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / targetSize / x-ui / unset_label
      Added value: +"No size target: Quality decides"
  2. Changed6 schema fields changed
    • changedInput schema / properties / metadataOnly / description
      Previous value: -"Strip metadata only (Ghostscript pdfmark) — no image downsampling."New value: +"Only strip the hidden details - author, title, producing software - and leave every page exactly as it is."
    • changedInput schema / properties / quality / description
      Previous value: -"Compression preset: light=300dpi, balanced=150dpi, mobile=96dpi, maximum=72dpi. Unknown values (including low/medium/high) silently fall back to balanced."New value: +"How hard to squeeze. Light keeps print quality (300 DPI); balanced is the everyday choice (150 DPI); mobile (96 DPI) and maximum (72 DPI) trade sharpness for size."
    • addedInput schema / properties / quality / x-show-when
      Added value: +{
      +  "metadataOnly": [
      +    "false"
      +  ]
      +}
    • changedInput schema / properties / targetSize / description
      Previous value: -"Target output size. When set, compresses iteratively to fit and overrides 'quality'."New value: +"Squeeze until the file fits this size. Overrides the preset above."
    • addedInput schema / properties / targetSize / title
      Added value: +"Squeeze down to"
    • addedInput schema / properties / targetSize / x-show-when
      Added value: +{
      +  "metadataOnly": [
      +    "false"
      +  ]
      +}
  3. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, so the description need not restate that it's a write operation. However, the description adds the 'preserving readability' guarantee and the DPI presets, but it does not disclose whether the original file is overwritten, where the output goes, or that compression is lossy. This is partial behavioral context, but not a full picture.

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?

The description is a single, information-dense sentence that front-loads the core action and then lists presets and modes. It's compact and skimmable, though slightly long due to the enumeration.

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?

Given 4 parameters and no output schema, the description covers the main modes but leaves out practical details like output file naming, whether the operation is in-place, and any size limits beyond the target-size parameter. It's adequate for a simple tool but not fully self-contained for an agent that needs to predict the outcome.

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 covers all parameters with descriptions, so the baseline is 3. The description adds a concise summary of quality presets and the target-size mode, which is helpful, but it largely repeats the schema's details and doesn't introduce new parameter-specific semantics beyond the 'metadata-only stripping' phrase, which is also in the 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 verb (compress) and resource (PDF), and explicitly mentions the outcome (reduce file size) while preserving readability. It also lists the quality presets and modes, distinguishing it from sibling tools like pdf_remove_metadata (which only strips metadata) by framing metadata stripping as a mode within compression.

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?

It provides clear context on when to use (to reduce PDF size) and explains the preset options, but it does not explicitly guide the agent on when to prefer this tool over the sibling pdf_remove_metadata for metadata-only stripping, nor does it mention any exclusions. The overlap with pdf_remove_metadata is noted but not resolved, leaving some ambiguity.

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