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 }
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 }

Need help with authentication, idempotency, or error codes?

Tool Reference | PDFHaul MCP Server | PDFHaul