# PDFMonkey MCP

> PDFMonkey generates professional PDF documents on demand by combining dynamic JSON payloads with pre-built HTML and CSS templates. It's built for high-volume document automation, handling everything from invoice creation to certificate generation entirely within your chat flow. You use it to list template metadata, track asynchronous job statuses via `check_pdf_status`, or retrieve secure download links using `get_pdf_details`—all without leaving your AI environment.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** pdf-generation, html-css-templates, document-automation, dynamic-data, high-volume-rendering

## Description

**PDFMonkey MCP Server - Generate Documents from Templates**

This server lets your AI client handle every step of document creation—from template selection to final download—without you ever leaving your chat window. You use it when you need to generate professional PDFs on the fly by feeding live JSON data into pre-built HTML and CSS templates.

*We're talking serious, high-volume automation here.* Forget juggling separate editors or file folders. This tool coordinates an entire document lifecycle programmatically. **`generate_pdf`** starts the process; you give it a template ID and the dynamic JSON payload, and your agent spins up the job.

### Building Your Document Workflow

You need to create documents? You initiate new PDF jobs using `generate_pdf`. For existing files, if the data changes but the structure stays the same, you modify them with **`update_document`**. 

Before you generate anything, you gotta know what templates you got. Run **`list_templates`** to see every single document type available on your account. If you need deep details about one specific template—say, its required fields or structure—you use **`get_template`** with its unique ID. You can also organize your work by listing project workspaces using **`list_workspaces`**, and then grab the metadata for any single container with **`get_workspace`**.

### Tracking and Fixing Files

Generating a PDF isn't instant; it's an async job. To know if it’s ready, you check its status using **`check_pdf_status`**, feeding it the job ID so your agent knows what to look for. You can also peek at all recent files and their basic status by running **`list_generated_documents`**. If the initial data was wrong, or maybe a template needs a tweak, you don't start over; you just force a rerun using **`regenerate_document`**.

### Getting the Goods (and Cleaning Up)

Once that PDF is done? You gotta get it. After generation, you call **`get_pdf_details`**. This tool pulls back all the metadata—file size, confirmation of what was created, and, most importantly, the secure, temporary download URL. That link lets your agent pass the file right to you within the chat flow. If a document is junk or you just need to wipe it clean from storage, **`delete_generated_pdf`** permanently removes that specific ID.

Here's how this works in practice: You tell your agent what you need—say, 'Generate Q3 invoices for these clients.' Your agent uses the tools to pull the template list, selects the right one, feeds it the JSON data payload via **`generate_pdf`**, monitors the status with **`check_pdf_status`** until it clears, and then uses **`get_pdf_details`** to hand you the final download link. It's a closed loop, done entirely through your conversation.

## Tools

### generate_pdf
Starts an asynchronous process to generate a new PDF using a designated template and data payload.

### delete_generated_pdf
Permanently removes a specified, already generated document from storage.

### get_pdf_details
Retrieves the metadata, file size, and secure download link for a specific, generated document ID.

### check_pdf_status
Checks the current status of a previously initiated PDF generation job.

### get_template
Fetches detailed information about a single PDF template by its unique identifier.

### get_workspace
Retrieves details and metadata for a specific document workspace container.

### list_generated_documents
Lists the IDs, names, and basic status of recently created PDF documents.

### list_templates
Retrieves a complete list of all available document templates managed by your account.

### list_workspaces
Lists the IDs and names of all defined project workspaces for organizing documents.

### regenerate_document
Forces a document generation job to run again, useful if the original data or template needs minor adjustments.

### update_document
Modifies content within an existing PDF document using a new dataset payload.

## Prompt Examples

**Prompt:** 
```
Create a document using template 'tpl_abc123' with this data: {'name': 'John Doe', 'amount': 150}.
```

**Response:** 
```
I've initiated the document generation. The status is currently 'pending' (ID: doc_xyz). Would you like me to check when the download link is ready?
```

**Prompt:** 
```
Generate a batch of 50 personalized certificate PDFs from my training completion template.
```

**Response:** 
```
Batch generation started for 50 certificates using template "Training Certificate v2" (tpl_4821). Status: Processing. 12 of 50 completed so far. Each certificate includes the participant's name, course title, completion date, and a unique certificate number. Estimated completion: 4 minutes. You will be notified when all documents are ready for download.
```

**Prompt:** 
```
Show me the current status and preview of document doc_9234 generated yesterday.
```

**Response:** 
```
Document doc_9234 status: Success. Template: "Monthly Report". Generated: May 12, 2025 at 3:45 PM. File size: 847 KB (6 pages). The document includes 3 charts, 2 tables, and a cover page. Download URL is active and expires in 72 hours. Last viewed: today at 9:15 AM.
```

## Capabilities

### Create or Update Documents
You initiate PDF creation jobs by providing a template ID and dynamic JSON data payload to generate new documents, or you modify existing PDFs using `update_document`.

### Manage Templates and Workspaces
You list available templates (`list_templates`) or workspaces (`list_workspaces`), and retrieve metadata for specific items to plan your document architecture.

### Track Document Status and History
You check the status of a job using `check_pdf_status` or view recent files with `list_generated_documents`, ensuring you know when a PDF is ready for download.

### Retrieve Download Links
After a document generates, you get the secure, temporary download URL and metadata by calling `get_pdf_details`.

## Use Cases

### Processing Payroll for 100 Employees
The payroll manager tells the agent: 'Generate PDFs for all employees using the monthly payslip template.' The agent runs `generate_pdf` with a list of employee records. It waits, periodically calling `check_pdf_status`, until all jobs are done. Finally, it uses `list_generated_documents` to provide a single file manifest containing all 100 download links.

### Fixing an Invoice Error
A client reports the wrong tax rate was printed on their invoice (doc_abc). Instead of re-generating everything, the agent uses `get_pdf_details` to pull up the document ID and then calls `update_document`, injecting only the corrected tax data. The PDF is fixed in minutes.

### Creating a Batch of Certificates
The training coordinator needs 20 certificates. They use `list_templates` to confirm 'Training Certificate v3'. Then, they feed the agent the list of 20 participants' data and call `generate_pdf`. The agent monitors the job until all documents are ready for download.

### Auditing Historical Documents
The compliance officer needs to check if a document from Q1 last year still exists. They use `list_generated_documents` to filter by date range, and then `get_pdf_details` on the specific ID to verify its file size and last access time.

## Benefits

- Eliminates status checks. Instead of manually polling an API endpoint to see if a PDF is ready, you ask your agent, 'Is doc_xyz done?' and use `check_pdf_status` for an instant answer.
- Centralized control. You manage templates and documents within the AI chat interface, using tools like `list_templates` and `list_workspaces`, so no data gets lost in separate apps.
- Instant retrieval. Once the generation job finishes, you don't have to guess where the file is. Use `get_pdf_details` on the document ID and get a secure, time-limited download link immediately.
- Data consistency. Need to change one field or update a whole report? Instead of starting over, use `update_document` to modify an existing PDF with new data payloads.
- Mass production capability. For batch jobs (like 50 certificates), your agent coordinates the entire flow: `generate_pdf` -> wait/check status -> loop through results -> get download link.
- Cleanup and governance. When a report is finished, you can use `delete_generated_pdf` to keep your document history clean and reduce clutter.

## How It Works

The bottom line is: your AI agent manages a multi-step process—from initiating the job to checking its status and finally retrieving the file—without you needing multiple manual clicks or API calls.

1. First, your AI agent calls `list_templates` to confirm the existence and details of the required document design.
2. Next, it uses `generate_pdf`, feeding in a template ID and dynamic data JSON. The job is asynchronous, so the tool returns a pending Job ID.
3. Finally, you use `check_pdf_status` with that Job ID until the status changes to 'Success,' at which point you call `get_pdf_details` to get the download link.

## Frequently Asked Questions

**How do I start a new PDF using `generate_pdf`?**
You must first provide the template ID and the JSON data payload for that template. The tool runs asynchronously, so you'll need to use `check_pdf_status` later with the returned job ID.

**Can I modify a PDF using `update_document`?**
Yes. You call `update_document` and supply the document ID along with the new data payload (JSON). This overwrites specific sections of the existing file, making it useful for corrections.

**`list_templates` shows all available designs?**
Yes. Running `list_templates` pulls a full list of every PDF template configured in your account, giving you their IDs and names to use with other tools.

**Is the download link from `get_pdf_details` permanent?**
No. The links are temporary and secure for a limited time (usually 72 hours). Use `get_pdf_details` right before you need the file to get an active URL.

**How do I handle batch generation of multiple PDFs?**
You must program your agent to loop. It should call `generate_pdf` for each item, keep track of all returned job IDs, and then monitor them sequentially using `check_pdf_status` until the entire batch is complete.

**How do I check the status of a PDF generation job using `check_pdf_status`?**
You pass the document ID to `check_pdf_status`. This tool tells you immediately if the generation is 'pending', 'processing', or 'success'. If it's pending, your AI client knows to check back later.

**How do I use `delete_generated_pdf` to clean up old drafts?**
Just provide the document ID you want gone. Calling `delete_generated_pdf` permanently removes that generated file from your account history. It's useful for keeping your workspace tidy.

**What information can I retrieve about a specific design using `get_template`?**
`get_template` retrieves detailed metadata for any template ID you supply. You get info like the required JSON fields and the current version, ensuring your data matches the template's needs.

**Can my AI automatically find the download link for a document after it has been generated?**
Yes! Use the `get_document` tool with the Document ID. Your agent will respond with complete metadata, including the `download_url` if the status is 'success'. Note that these links are temporary for security.

**How do I find my PDFMonkey Secret Key?**
Log in to your PDFMonkey dashboard, navigate to **My Account**, and you will find your unique secret API key in the 'Secret Key' section.

**What status should I expect when a document is first created?**
The initial status is usually 'pending' while the document is being rendered. You can ask the AI to poll the status until it becomes 'success' to retrieve the download link.