Compress PDF
compress_pdfReduce PDF file size with Ghostscript, keeping text as text. Either pick a quality level, or give target_kb to get the best-quality file under that size (reports whether the target was met).
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 | The PDF to compress. | |
| level | No | light = best quality, strong = smallest file. Ignored when target_kb is set. | balanced |
| grayscale | No | Also convert to grayscale (much smaller for scans). | |
| target_kb | No | Optional maximum size in KB (e.g. 200). The server searches for the best quality that fits. | |
| remove_images | No | Drop all images, keeping only text and vector drawings. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| info | No | Facts about the PDF (get_pdf_info) or the result (e.g. target_met for compress_pdf). | |
| note | No | Anything the user should know about the result. | |
| text | No | Extracted text (pdf_to_text, ocr_pdf). | |
| files | Yes | Result files. Download them before expires_at; pass file_id to another tool to chain. |