Preview template PDF
render_dsl_previewRender a DSL template + data to a preview PDF. Free (no credits), always watermarked 'PREVIEW — NOT FOR USE'. Returns JSON metadata plus the PDF bytes as an embedded base64 resource. No artifact is recorded, so there is no download URL or resource link. Mirrors POST /api/v1/preview.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dsl": "<dsl>"
},
"name": "render_dsl_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dsl | Yes | The template source: a builder DSL script that assigns `const template = doc(...)` and optionally `const sampleData = {...}`. | |
| data | No | Optional binding data. Falls back to the script's sampleData when omitted. | |
| title | No | Document title written to the PDF metadata. PDF viewers show it in the window title instead of the file name. When omitted, the title is 'Document'; a title set in the DSL's doc() is not used. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| renderMs | Yes | Server-side render time in milliseconds. | |
| pageCount | Yes | Pages in the rendered PDF. | |
| sizeBytes | Yes | Size of the PDF in bytes. | |
| templateWarnings | Yes | Problems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart. Each originates in the DSL or the data. |