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
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute path to the PDF to compress. | |
| level | No | Compression strength. low keeps images at 300 DPI, medium at 150, high at 72. | medium |
| output_path | No | Absolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix. |