MCP Server/Tool Reference

Tool Reference

Every tool is callable via the MCP protocol. Parameters marked required must be present; optional parameters may be omitted. All mutation tools accept an optional idempotencyKey.

Files
list_filesFiles

Return all files stored in the authenticated account.

Response

{ id: string; originalname: string; size: number; createdAt: string }[]
get_file_urlFiles

Get a signed download URL valid for 15 minutes.

ParameterTypeRequiredDescription
fileIdstringyesID of the file to get a URL for.

Response

{ url: string }
upload_from_urlFiles

Fetch a remote PDF by URL and save it to the account. The URL must return Content-Type: application/pdf.

ParameterTypeRequiredDescription
urlstringyesPublic URL of a PDF file.
filenamestringnoFilename to save as. Defaults to the URL basename.
idempotencyKeystringnoUnique key to prevent duplicate uploads on retry.

Response

{ fileId: string; originalname: string; size: number }
Edit
merge_pdfsEdit

Combine two or more PDFs into a single document in the order given.

ParameterTypeRequiredDescription
fileIdsstring[]yesOrdered array of file IDs to merge. Minimum 2.
outputNamestringnoFilename for the merged PDF.
idempotencyKeystringnoUnique key to prevent duplicate merges on retry.

Response

{ fileId: string; originalname: string; size: number }
split_pdfEdit

Extract page ranges from a PDF into separate output files.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to split.
rangesstringyesComma-separated page ranges, e.g. "1-3,4-6,7-10".
idempotencyKeystringnoUnique key to prevent duplicate splits on retry.

Response

{ fileId: string; originalname: string; size: number }[]
compress_pdfEdit

Reduce file size. The quality parameter controls the size/fidelity tradeoff.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to compress.
quality'low' | 'medium' | 'high' | 'extreme'no · mediumlow = best quality, largest file. extreme = smallest file, most quality loss.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number; originalSize: number; compressionRatio: number }
rotate_pagesEdit

Rotate specific pages by 90, 180, or 270 degrees.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to modify.
pagesnumber[]yes1-indexed page numbers to rotate.
degrees90 | 180 | 270yesRotation in degrees. 90 = clockwise, 270 = counter-clockwise.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string }
reorder_pagesEdit

Rearrange pages by supplying the complete desired page sequence.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to reorder.
pageOrdernumber[]yesComplete new sequence as 1-indexed page numbers, e.g. [3,1,2] puts page 3 first.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; originalPageCount: number; newPageCount: number }
delete_pagesEdit

Remove specific pages. The remaining pages keep their original order.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to edit.
pagesnumber[]yes1-indexed page numbers to remove.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; originalPageCount: number; removedPages: number[]; finalPageCount: number }
duplicate_pagesEdit

Duplicate specific pages, inserting each copy immediately after its original. Supply the complete final page sequence with repeats where you want duplicates -- can also reorder in the same call. Maximum 500 entries.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to duplicate pages in.
pageSequencenumber[]yesComplete final page sequence as 1-indexed page numbers, repeats allowed, e.g. [1,1,2,3].
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; originalPageCount: number; finalPageCount: number; duplicatedCount: number }
remove_duplicate_pagesEdit

Automatically detect and remove duplicate pages. A page is a duplicate only when its rendered content exactly matches another page -- similar-looking pages with different data are not flagged. The first occurrence is kept.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to clean up.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string | null; originalname: string | null; originalPageCount: number; finalPageCount: number; pagesRemoved: number; nothingToRemove: boolean }
remove_empty_pagesEdit

Automatically detect and remove blank pages from a PDF.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to clean up.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string | null; originalname: string | null; originalPageCount: number; finalPageCount: number; pagesRemoved: number; nothingToRemove: boolean }
edit_metadataEdit

Edit document metadata. Only the fields provided are changed; at least one is required.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to edit.
titlestringnoDocument title.
authorstringnoDocument author.
subjectstringnoDocument subject.
keywordsstringnoDocument keywords.
creatorstringnoApplication that created the original document.
producerstringnoApplication that produced the PDF.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; updatedFields: string[] }
Convert
pdf_to_imagesConvert

Convert each page to a separate image file stored in the account. Use get_file_url on each returned fileId to download.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to convert.
format'png' | 'jpg'no · pngOutput image format.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; page: number }[]
pdf_to_wordConvert

Convert a PDF into an editable Word document (.docx).

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
word_to_pdfConvert

Convert a Word document (.doc or .docx) stored in the account into a PDF.

ParameterTypeRequiredDescription
fileIdstringyesID of the Word file to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
pdf_to_excelConvert

Convert a PDF into an Excel spreadsheet (.xlsx), reconstructing the full document content -- form labels, key-value pairs, section titles, and tables -- in reading order on a single sheet. Use extract_tables instead for just the tables.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
extract_tablesConvert

Extract only the tables from a PDF into an Excel spreadsheet, one sheet per table. Everything that is not a table is left out. Use pdf_to_excel instead for the full document content.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to extract tables from.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
pdf_to_powerpointConvert

Convert a PDF into an editable PowerPoint presentation (.pptx), one slide per page.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
excel_to_pdfConvert

Convert an Excel spreadsheet (.xls or .xlsx) stored in the account into a PDF.

ParameterTypeRequiredDescription
fileIdstringyesID of the Excel file to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
powerpoint_to_pdfConvert

Convert a PowerPoint presentation (.ppt or .pptx) stored in the account into a PDF.

ParameterTypeRequiredDescription
fileIdstringyesID of the PowerPoint file to convert.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number }
ocr_pdfConvert

Make a scanned or image-based PDF searchable by running OCR on it. Returns a new PDF with a real, selectable text layer; the original file is untouched. Skips OCR automatically if the PDF already has a usable text layer, unless forceOcr is set. Use pdf_to_word instead if you want a Word/Excel output -- it already runs OCR internally.

ParameterTypeRequiredDescription
fileIdstringyesID of the PDF to OCR.
language'eng' | 'spa' | 'por' | 'fra' | 'deu' | 'ind' | 'ara' | 'chi_sim' | 'hin' | 'jpn' | 'kor' | 'rus' | 'ita' | 'tur' | 'nld'no · engPrimary language of the document text.
forceOcrbooleanno · falseForce a full OCR re-recognition pass even if the PDF already appears to have a text layer.
idempotencyKeystringnoUnique key to prevent duplicate operations on retry.

Response

{ fileId: string; originalname: string; size: number; ocrApplied: boolean }

Need help with authentication, idempotency, or error codes?

Tool Reference | PDFHaul MCP Server | PDFHaul