Skip to main content
Glama

Compress & Optimize PDF

pdf_compress

Reduce local PDF file size with object stream compaction or Ghostscript DPI presets, and optionally save the compressed PDF to a chosen output path.

Instructions

Compress a local PDF file using object stream compaction (always available) or Ghostscript DPI optimization when Ghostscript is installed locally.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "inputPath": "<inputPath>"
    },
    "name": "pdf_compress"
  }
}

Input Schema

NameRequiredDescriptionDefault
presetNo"structural" rewrites clean compressed streams; "ebook"/"screen"/"printer" use local Ghostscript if installedstructural
inputPathYesLocal PDF file path
outputPathNoOptional compressed PDF path

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It does disclose the key dependency (Ghostscript must be installed locally) and the availability fallback, which is real value. However, for a tool that writes a file it says nothing about whether the input is overwritten, what happens when outputPath is omitted, or what is returned.

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?

A single front-loaded sentence that states the action, the two mechanisms, and the installation prerequisite with no filler. Nothing in it is redundant.

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?

The description covers the two compression paths and the Ghostscript prerequisite, which is the core of the tool. It is incomplete for a file-producing mutation tool with no annotations and no output schema: the default destination when outputPath is omitted, and whether the original is modified, are left unstated.

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 100% and the preset enum already documents each mode, so the schema does the heavy lifting. The description only reinforces that structural is always available while the DPI presets require Ghostscript, adding marginal meaning beyond the schema. Baseline 3 is appropriate.

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?

The description names a specific verb ('Compress') and resource ('local PDF file') and even distinguishes two internal strategies (object stream compaction vs. Ghostscript DPI optimization). It doesn't explicitly contrast with siblings, but the resource type (PDF) already separates it from image_compress_convert and media_compress_video.

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 gives conditional guidance for choosing a strategy: structural is 'always available,' while Ghostscript presets depend on local installation. That is useful when-to-use context for the presets, but there is no guidance on when to prefer this tool over pdf_strip_metadata or image_compress_convert, nor any stated exclusions.

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