Render a code template against a product — returns the image inline
preview_renderRenders the given HTML+CSS template against one product's variables and returns the PNG/JPEG INLINE as base64 image content. Use this to iterate on a design: write template HTML/CSS, call preview_render, look at the result, refine, repeat. Pass templateId to use an existing template, OR pass codeHtml + codeCss directly for ad-hoc previews without saving.
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": {
"feedId": "<feedId>"
},
"name": "preview_render"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| feedId | Yes | ||
| height | No | ||
| codeCss | No | Inline CSS. Optional if templateId set. | |
| overlay | No | Draw a placement's safe zones and app UI over the result (red = covered by the caption, buttons or CTA; green box = safe for text). Must match the render's aspect ratio. Preview only — never part of the served image. | |
| codeHtml | No | Inline HTML body. Required if templateId not set. | |
| productId | No | Product to render against — accepts EITHER the feed's own id (g:id / externalId, e.g. "4-1") OR Emberfeed's internal row id; both come back from list_products. Omit to use the first product in the feed. | |
| templateId | No | If set, uses the stored template. Overrides codeHtml/codeCss. | |
| outputFormat | No | jpeg | |
| backgroundColor | No | #FFFFFF |