# HotDocs MCP

> HotDocs MCP automates complex document assembly workflows by connecting your favorite AI agent directly to template libraries. It lets you create work items, conduct virtual interviews to gather required data, and generate finalized legal documents—like contracts or compliance reports—without ever touching the web interface.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** document-automation, template-management, assembly-workflows, compliance-automation, data-interview

## Description

Document creation shouldn't feel like filling out 17 separate forms in a browser. This MCP gives your AI client full control over document assembly using HotDocs Advance templates. You can tell your agent, 'Generate a new employment contract for Jane Doe,' and it handles everything after that.

Your agent first discovers the necessary template packages. It then creates a work item to track the process and initiates an interview session so you can answer questions conversationally. Once all data is collected, the system runs the final assembly, injecting all your answers into the correct document variables and generating files like PDFs or Word documents. You don't just get a file; you get auditable proof of what information was captured along the way.

If you're building out an enterprise process—say, onboarding new clients or handling compliance audits—this MCP provides the necessary structure to make that happen programmatically. It’s one of the most powerful document automation tools available in the Vinkius catalog because it lets your AI act like a dedicated specialist, managing data flow and generation through natural conversation.

## Tools

### complete_assembly
Runs the final process, taking all collected answers and building the full document based on the template's rules.

### create_interview_session
Prepares the system by setting up a unique session to collect structured answers for the document variables.

### create_work_item
Establishes a new record identifier, which acts as the single reference point for all subsequent data and assembly actions.

### get_auth_token
Retrieves a fresh API access token. Use this if any other tool fails due to authentication errors.

### get_document_content
Downloads the finished document content, providing both the file and a direct URL for immediate use.

### get_template_package
Fetches detailed information about a specific template package ID to understand its structure before building a record.

### get_unanswered_variables
Checks an assembled document and reports any variables that were not provided answers, helping you validate completeness.

### get_work_item
Retrieves the full details of a specific work item at any point—before or after assembly attempts.

### list_documents
Lists all generated documents for a given work item, providing their IDs and metadata needed for download.

### list_template_versions
Shows the historical versions of a template package, helping you know which version is currently live or active.

### list_template_packages
Lists every available document template package in your tenancy so you can discover all possible documents to create.

### list_work_items_by_date
Finds specific records by filtering them using a defined start and end date range, useful for reporting.

### list_work_items
Searches for work items using optional filters like user ID or a general date range to locate existing jobs.

### update_answers
Allows you to batch-feed data into an existing record using XML format, ideal when the answers are already compiled outside of a conversation.

## Prompt Examples

**Prompt:** 
```
List all available template packages in my HotDocs tenancy.
```

**Response:** 
```
I've fetched your template packages. You currently have 3 template packages available: 'Employment Contract Template' (ID: emp-ctr-001), 'NDA Template' (ID: nda-std-002), and 'Service Agreement Template' (ID: svc-agr-003). Which template would you like to use for document assembly?
```

**Prompt:** 
```
Create a new work item 'contract-2024-001' using the employment contract template and assemble a document with these details: employee name is John Smith, position is Software Engineer, start date is March 1st 2024, salary is $95,000.
```

**Response:** 
```
I've completed the full document assembly workflow:
1. Created work item 'contract-2024-001' successfully
2. Injected the employee data as answer XML
3. Completed document assembly

The document is now ready. I found 1 assembled document: 'Employment_Contract_John_Smith.docx' (Document ID: doc-789456). Would you like me to download it for you?
```

**Prompt:** 
```
Show me all work items created in the last 30 days and check if there are any unanswered variables in the documents.
```

**Response:** 
```
I found 8 work items created in the date range 2024-03-08 to 2024-04-07. Checking documents for unanswered variables... I noticed 2 work items have incomplete interviews with unanswered variables: 'contract-2024-005' has 3 unanswered variables (emergency_contact, benefits_selection, stock_options) and 'nda-2024-012' has 1 unanswered variable (jurisdiction_state). Would you like me to provide the details of these unanswered variables?
```

## Capabilities

### Discovering Templates
List all template packages and check version history to find exactly which document structure you need.

### Managing Records
Create, inspect, and update work items—the digital records that hold the data for an assembly job.

### Conducting Virtual Interviews
Initialize interactive sessions to programmatically collect specific answers required by a template before generation.

### Generating Documents
Inject collected data and trigger the final assembly process to generate ready-to-download documents.

### Auditing and Validation
Check which required variables were left unanswered or retrieve a complete history of document attempts for compliance checks.

## Use Cases

### Onboarding a new employee
The HR agent needs three documents: contract, benefits guide, and tax form. It starts by listing all template packages (`list_template_packages`), then creates the work item and runs `create_interview_session` to gather salary and start dates. Finally, it calls `complete_assembly` to generate all three branded files.

### Handling a legal discovery request
A compliance analyst needs to find every document related to 'Project X' created last quarter. The agent uses `list_work_items_by_date` and filters by user ID, then checks the resulting records with `get_unanswered_variables` to flag any potential gaps in documentation.

### Processing client loan applications
The finance team has 100 completed application forms saved as data files. Instead of manually entering the details, the agent uses `update_answers` with a batch XML dump for all 100 records, then runs `complete_assembly` to generate 100 final loan agreements.

### Auditing document completeness
A manager wants to review the last month's contract signings. They use `list_work_items` by date, then for each item, they check with `get_unanswered_variables`. This instantly highlights if any required fields were missed during the interview process.

## Benefits

- Stop copy-pasting data across multiple forms. By using the `create_interview_session` tool, your agent captures necessary inputs through natural conversation, building a complete record before generation.
- Eliminate manual document retrieval. After running `complete_assembly`, you can immediately use `list_documents` and then `get_document_content` to download the final file without clicking anything in the UI.
- Prove compliance easily. Use `get_unanswered_variables` on any assembly record to instantly check if a document is missing critical fields, giving you an auditable checklist of incomplete records.
- Improve data tracking across teams. Instead of relying on shared spreadsheets, use `list_work_items_by_date` and `list_work_items` to create a single source of truth for all document activity over time.
- Handle complex inputs batch-wise. If you have 50 records ready but no interview flow, simply call `update_answers` with XML data to bypass the conversational stage entirely.

## How It Works

The bottom line is that your AI client manages the entire multi-step process—from initial data gathering to final download—in a single conversation flow.

1. First, ask your agent to use the `list_template_packages` tool to see what template structures are available.
2. Next, have your agent create a new record using `create_work_item`, then run `create_interview_session` to gather all necessary data points from you or an external source.
3. Finally, trigger the generation by calling `complete_assembly`, and retrieve the finished file content using `get_document_content`.

## Frequently Asked Questions

**How do I find out what templates are available using HotDocs MCP?**
You use `list_template_packages` first. This tool gives you a master list of all template packages and their unique IDs, so you know exactly which document structure to work with.

**Do I have to fill out the interview manually every time with HotDocs MCP?**
No. While `create_interview_session` starts a conversational flow, if you already have the data (like from a CRM), you can skip that step and use `update_answers` with XML directly.

**Can I check for incomplete contracts using HotDocs MCP?**
Yes. After an assembly attempt, run `get_unanswered_variables`. This tells you exactly which required fields were missed, making your compliance audits much faster and more accurate.

**What if I need to download the document content after using HotDocs MCP?**
You first call `list_documents` to get the unique document ID. Then, pass that ID along with the workItemId into `get_document_content` to retrieve the file.

**Does HotDocs MCP handle multiple versions of a template?**
Yes. Use `list_template_versions`. This allows you to check the version history for any template package, ensuring you are always using the most current or required format.