PDF Generator API MCP by usefulapi

v1.1.0
io.usefulapi/pdf-generator-api Checked 7 hours ago Published 7 days ago

Generate PDFs from templates and convert HTML or web pages to PDF in PDF Generator API.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

pdfgeneratorapi_get_workspace Get workspace

Get the connected workspace: its numeric id, identifier, whether it is the master workspace, and whether the key owner is an admin. Good first call to confirm the connection. PDF Generator API: GET /workspaces/{workspaceIdentifier}.

pdfgeneratorapi_list_templates List templates

List the document templates in the workspace (id, name, tags, editor type, timestamps). Use it to find a template id for pdfgeneratorapi_generate_document. PDF Generator API: GET /templates.

ParameterTypeDescription
pageintegerPage number (default 1).
per_pageintegerResults per page (max 100).
searchstringFilter templates by name.

pdfgeneratorapi_get_template Get template

Get one template with its layout, pages and data settings. Use it to see what the template draws. PDF Generator API: GET /templates/{templateId}.

ParameterTypeDescription
template_id *stringThe template id (from pdfgeneratorapi_list_templates).

pdfgeneratorapi_get_template_data_fields Get template data fields

List the data fields one template reads (the keys to put in the data object of pdfgeneratorapi_generate_document). Call it before you generate. PDF Generator API: GET /templates/{templateId}/data.

ParameterTypeDescription
template_id *stringThe template id (from pdfgeneratorapi_list_templates).

pdfgeneratorapi_list_documents List generated documents

List documents generated with output url and still stored (each has a public link, kept 30 days). Filter by template, date range or name. PDF Generator API: GET /documents.

ParameterTypeDescription
end_datestringCreated on or before this date (yyyy-mm-dd).
pageintegerPage number (default 1).
per_pageintegerResults per page (max 100).
searchstringFilter by document name.
start_datestringCreated on or after this date (yyyy-mm-dd).
template_idstringOnly documents made from this template id.

pdfgeneratorapi_generate_document Generate document from template

Merge a template with data and create a PDF (or HTML). Default output url stores the file on PDF Generator API for 30 days and returns its public link; this uses one generation from the plan quota. output base64 returns the whole file inline, which can be large. Set testing true to add the vendor's test marking. PDF Generator API: POST /documents/generate.

ParameterTypeDescription
data *objectField values for the template, keyed by the names from pdfgeneratorapi_get_template_data_fields.
template_id *stringThe template id (from pdfgeneratorapi_list_templates).
formatstringOutput format (default pdf).
namestringDocument name shown in the vendor's document list.
outputstringurl = stored public link for 30 days (default); base64 = inline file.
testingbooleantrue = mark the output as a test document (default false).
version_idintegerTemplate version id (default: the current version).

pdfgeneratorapi_copy_template Copy template

Copy an existing template under a new name. The original template is not changed. Use it to make a variant before you edit the copy in the vendor's editor. PDF Generator API: POST /templates/{templateId}/copy.

ParameterTypeDescription
name *stringName of the new template copy.
template_id *stringThe template id (from pdfgeneratorapi_list_templates).

pdfgeneratorapi_convert_html_to_pdf Convert HTML to PDF

Render an HTML string to a PDF and return it inline as base64. Keep the HTML small: the base64 reply can be large. Nothing is stored on the vendor side. PDF Generator API: POST /conversion/html2pdf.

ParameterTypeDescription
content *stringThe full HTML document or fragment to render.
filenamestringFile name to report in the reply.
orientationstringPage orientation (default portrait).
paper_sizestringPaper size (default a4).

pdfgeneratorapi_convert_url_to_pdf Convert web page to PDF

Load a public web page in the vendor's browser and return it as a PDF, inline as base64. The URL must be reachable from the internet; private or login-only pages fail. Nothing is stored on the vendor side. PDF Generator API: POST /conversion/url2pdf.

ParameterTypeDescription
url *stringThe public http or https page to render.
filenamestringFile name to report in the reply.
orientationstringPage orientation (default portrait).
paper_sizestringPaper size (default a4).