Skip to main content
Glama

compress_pdf

Shrink PDF files by downsampling images to reduce file size for email or upload while keeping text selectable. Already optimized files return 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. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

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": {
      "file": "<file>"
    },
    "name": "compress_pdf"
  }
}

Input 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.7/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 it well: overwrite semantics on output_path, the return value (path plus size in bytes), the 50 MB input cap, quota consumption per call, in-memory processing with no storage, and the no-op behavior for already-optimized inputs.

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?

Five short sentences, front-loaded with the action and effect, then the use case, then operational constraints. No sentence is filler and the ordering follows what an agent needs before deciding to call.

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 still explains exactly what comes back (path and byte size). Size limit, quota cost, overwrite risk and storage behavior are all covered, leaving nothing an agent would need to infer before calling.

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 explains file, level and output_path. The description adds real value on top, spelling out that output_path replaces any existing file and defaulting behavior, and tying level indirectly to the quality/size tradeoff.

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 and resource ('Shrink a PDF') plus the mechanism (image downsampling), and notes text stays selectable. This clearly separates it from conversion/extraction siblings like extract_pdf_text or pdf_to_jpg, none of which compress.

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 trigger case ('when a PDF is too large to email or upload') and notes already-optimized files are returned unchanged, which heads off a wasteful retry. It doesn't name an alternative tool or an exclusion condition, but no sibling covers compression, so the guidance is effectively complete.

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