sheetrender-mcp

v0.5.4
io.github.sheetrender/sheetrender-mcp Checked 10 hours ago Published 1 month ago

Render PDFs from templates and spreadsheet data via SheetRender, locally or at mcp.sheetrender.com

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

render_pdf Render HTML to PDF

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool renders a single PDF from HTML you supply and returns the path to the saved file. Use it for one-off documents — an invoice, a report, a certificate — where you are writing the markup yourself. Use render_template instead when the user already has a saved template. `html` must be a complete HTML document (<html>, <head>, <body>) with all CSS inline in a <style> tag: external stylesheets, fonts and scripts are not fetched. Use @page and mm/cm units for print layout. `data` keys become Jinja template vari…

ParameterTypeDescription
html *stringA complete HTML document with inline CSS. May contain Jinja placeholders filled from `data`.
dataobjectTemplate variables as a flat JSON object. Each key becomes a Jinja variable, so {"customer": "Acme"} makes {{ customer }} available in the HTML.
page_settingsobjectOptional page setup for the PDF.

list_templates List SheetRender templates

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool lists the templates saved in the user's account, with the id each one needs. Call it first whenever the user refers to a template by name ("render the invoice template") so you can map that name to an id — every other tool here takes a template_id, including create_dataset and list_datasets. Takes no arguments.

design_template Design a template

Design a saved template from exactly one of dataset_id, inline rows, or data_base64 with data_filename (CSV or XLSX, up to 10 MB), and an example, brief, or style_id. Use an example alone, or a brief with optional style_id. Examples accept PDF, PNG, JPG, WebP or DOCX as base64 with a filename. Local data_path can supply the data; example_path can supply the example. Waits up to 3 minutes; returns the design status, template id, mapping and preview URL.

ParameterTypeDescription
briefstringWritten design instructions.
data_base64stringBase64 CSV or XLSX contents; at most 10 MB decoded.
data_filenamestringData filename including .csv or .xlsx extension.
data_pathstringLocal CSV or XLSX file path; at most 10 MB; ~ is expanded.
dataset_idstringExisting dataset id; use exactly one data source.
example_base64stringBase64 example file contents.
example_filenamestringExample filename including its extension.
example_pathstringLocal example file path; ~ is expanded.
fit_one_pagebooleanFit the design onto one page.
namestringTemplate name.
rowsarrayFlat data rows; use exactly one data source.
style_idstringSaved style id.

get_design Check a template design

Get a design's status and, when complete, its template id, name, mapping and preview URL.

ParameterTypeDescription
design_id *stringDesign id returned by design_template.

render_template Render a saved template to PDF

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool renders one PDF from a template already saved in the user's account and returns the path to the saved file. Use it when the user wants a document in their existing design. Get `template_id` from list_templates. Use render_pdf instead when you are writing the HTML yourself. `data` supplies one row's worth of values: each key becomes a Jinja variable in the template's HTML. To render a PDF for every row of a spreadsheet, load the rows with create_dataset or upload_dataset and run create_batch_job rather than c…

ParameterTypeDescription
data *objectTemplate variables as a flat JSON object. Each key becomes a Jinja variable, so {"customer": "Acme"} makes {{ customer }} available in the HTML.
template_id *stringTemplate id from list_templates.
page_settingsobjectOptional page setup for the PDF.

create_dataset Create a dataset from JSON rows

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool turns rows you already hold — as JSON — into a dataset a batch job can render, and returns the dataset id plus the column keys. This is the normal way to start a batch: the user asks for "an invoice for each of these clients" or "a letter per employee", you assemble the rows, and this uploads them. Use upload_dataset instead when the data is already a file on disk, and list_datasets when the user is referring to a dataset that already exists. `rows` is a flat array of flat objects, one per document: [{"c…

ParameterTypeDescription
rows *arrayOne flat object per document. Keys become spreadsheet columns; values must be scalars (string, number, boolean or null).
template_id *stringTemplate id from list_templates. The dataset lands in that template's project.
namestringOptional label for the dataset, used as its stored filename so the user recognises it later, e.g. "march-invoices".

upload_dataset Upload a spreadsheet as a dataset

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool uploads a local .csv or .xlsx file as a dataset a batch job can render, and returns the dataset id plus the column keys. Use it when the user points at a file they already have — an export, a spreadsheet they attached, something you just wrote to disk. Use create_dataset instead when you are holding the rows as JSON: it avoids writing a file only to read it straight back. `file_path` is a path on the machine running this MCP server, which is the user's machine, not SheetRender's. The first row must be the…

ParameterTypeDescription
file_path *stringPath to a .csv or .xlsx file on the user's machine. Absolute is safest; `~` is expanded.
template_id *stringTemplate id from list_templates. The dataset lands in that template's project.

list_datasets List datasets for a template

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool lists the datasets a batch job can render with a given template — everything in that template's project, newest first — with each one's id, row count and column keys. Call it when the user refers to data they have already loaded ("use the customer list I uploaded") so you can find its id, or to re-run a batch over an existing dataset instead of creating a duplicate. When there is nothing suitable, create one with create_dataset or upload_dataset. It is also the quickest way to see a dataset's sanitized c…

ParameterTypeDescription
template_id *stringTemplate id from list_templates.

create_batch_job Start a batch PDF job

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool queues a batch job that renders one PDF per row of a dataset, and returns the job id. Use it when the user wants many documents at once — "an invoice for every row", "one letter per employee" — rather than calling render_template in a loop. The full sequence, all of it available here: 1. list_templates — the user's designs, and the template_id for the rest. 2. create_dataset (rows you hold as JSON) or upload_dataset (a local .csv/.xlsx) — returns the dataset_id. list_datasets finds one that already e…

ParameterTypeDescription
dataset_id *stringDataset id from create_dataset, upload_dataset or list_datasets. It must belong to the same template's project.
template_id *stringTemplate id from list_templates.
filename_templatestringNaming pattern for output files, with column placeholders, e.g. "invoice-{{ invoice_no }}". Saved to the template.
group_bystringColumn name to group rows by, producing one multi-page PDF per distinct value instead of one per row. Saved to the project.

get_job Check a batch PDF job

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool reports the progress of a batch job started by create_batch_job. Returns the status, rows done/failed, and — once the job reaches a finished state ("succeeded", "partial", "failed" or "cancelled") — the id and filename of every rendered document. The document list is empty while the job is still in "queued", "retry_queued" or "running", so poll again after a short wait rather than assuming zero documents. Pass those document ids to get_document to download the individual PDFs.

ParameterTypeDescription
job_id *stringJob id returned by create_batch_job.

get_document Download a rendered document

SheetRender turns HTML templates plus spreadsheet rows into rendered PDFs. This tool downloads one PDF produced by a batch job and returns the path to the saved file. `document_id` comes from get_job on a finished batch — that is the only place these ids appear, so call get_job first and take an id from its document list. A document id is not a template id or a job id. Use it to fetch a specific output the user asked about, or to spot-check a batch. Fetching every document of a large batch one at a time is slow; point the user at the SheetRender web app for the merged PDF or ZIP instead.…

ParameterTypeDescription
document_id *stringDocument id from a finished job's document list in get_job.