Skip to main content
Glama

Render a code template against a product — returns the image inline

preview_render
Read-only

Renders 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

NameRequiredDescriptionDefault
widthNo
feedIdYes
heightNo
codeCssNoInline CSS. Optional if templateId set.
overlayNoDraw 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.
codeHtmlNoInline HTML body. Required if templateId not set.
productIdNoProduct 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.
templateIdNoIf set, uses the stored template. Overrides codeHtml/codeCss.
outputFormatNojpeg
backgroundColorNo#FFFFFF

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint and openWorldHint; the description adds the crucial behavioral fact that the image comes back inline as base64 content, and that ad-hoc code rendering does not save anything. It also implies overlays are preview-only via the schema. Missing are render latency or failure behavior, but the added context is substantive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences: what it returns first, then the iteration loop, then the two parameter modes. No filler, and the most decision-relevant information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter tool with no output schema, the description covers the return value (inline base64 image) and the two input modes, which are the main things an agent needs. Gaps remain around the required feedId, default dimensions, and the aspect-ratio constraint on overlay, which the schema mentions but the description does not reinforce.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 50% schema coverage and 10 parameters, the description reinforces the templateId vs codeHtml/codeCss precedence and the no-save semantics of the code path, which is genuinely useful. However, it never mentions feedId (the only required parameter), the width/height sizing controls, outputFormat, or backgroundColor, leaving those to a schema that only partially documents them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — renders an HTML+CSS template against one product's variables — and specifies the output form (PNG/JPEG returned inline as base64). This clearly separates it from siblings like create_code_template (persists) or mockup_placement (different render path).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit workflow (write HTML/CSS, call preview_render, inspect, refine, repeat) and explains the two entry modes: templateId for stored templates or codeHtml+codeCss for ad-hoc previews without saving. It does not say when to prefer a sibling such as mockup_placement instead, so it stops short of full alternative routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources