Skip to main content
Glama

compress_pdf

Reduce PDF size by downsampling images, keeping text selectable, for files too large to email or upload; already-optimized files remain unchanged.

Instructions

Shrink a PDF by downsampling its images. Image-heavy files lose 30-80% of their size; text stays selectable. Use this when a PDF is too large to email or upload. Already-optimized files come back unchanged rather than larger.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesAbsolute path to the PDF to compress.
levelNoCompression strength. low keeps images at 300 DPI, medium at 150, high at 72.medium
output_pathNoAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.2/5.0
Behavior4/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 reasonably well: it discloses the compression mechanism, expected size reduction (30-80% for image-heavy files), that text remains selectable, and that incompressible files are returned unchanged rather than inflated. It omits permission/runtime details and how image quality degrades at higher levels.

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?

Four short sentences, each earning its place, with the core purpose and mechanism front-loaded before the motivating scenario and edge-case behavior.

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?

For a 3-param mutation tool with no output schema and no annotations, the description covers purpose, effect, and the unchanged-file edge case well. Minor gaps remain around overwrite semantics and permission needs.

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 description coverage is 100%, so file, level, and output_path are fully documented in the schema, including the DPI mapping for each enum value. The description adds nothing beyond what the schema already provides, so baseline 3 applies.

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?

States a specific verb (shrink) and resource (PDF) plus the mechanism (downsampling images), which uniquely distinguishes it from all siblings like merge_pdfs, split_pdf, and ocr_pdf.

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 clear when-to-use context ("when a PDF is too large to email or upload") and notes that already-optimized files come back unchanged, implying a no-op guard. It stops short of naming alternative siblings or explicit exclusions.

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