Merge PDFs
pdf_merger_mergeMerge uploaded PDFs in a specified order into one PDF. Provide session ID and file order to get a download token and page count.
Instructions
Merge previously uploaded PDFs in a specified order into a single PDF.
Returns a one-time download token. Use pdf_merger_get_download_url to build the download link. The session is consumed after merging — re-upload files to merge again.
Args:
session_id (string): UUID of the upload session.
file_order (string[]): Ordered array of file UUIDs. The first entry becomes the first pages of the merged output. Must contain at least 2 file IDs and at most 30.
Returns (JSON): { "token": "uuid", "page_count": 45, "size_formatted": "2.3 MB", "download_url": "https://..." }
Workflow:
Upload PDFs using pdf_merger_upload_pdfs
(Optional) Remove unwanted files using pdf_merger_remove_file
Merge using this tool with desired file order
Use the returned download_url to download the merged PDF
Error Handling:
Session not found → 404
File order contains unknown IDs → 400
Encrypted/corrupt PDF → 422
Less than 2 files → 400
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_order | Yes | Ordered array of file IDs specifying the merge sequence. The first ID becomes the first pages of the output. | |
| session_id | Yes | Session ID containing uploaded PDFs. |