Skip to main content
Glama

HTML/CSS to Image API

Create a Template

create_template

Saves a reusable HTML/CSS image template for rendering multiple images with different values. Put Handlebars placeholders such as {{title}} in the HTML; substitutions are evaluated in HTML only. Returns item.template_id and item.template_version. Call create_templated_image with that ID and template_values to render an image. Use create_image for a single image from supplied HTML/CSS, or update_template to revise an existing template.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesTemplate HTML, optional CSS, name, description, and rendering defaults. Choose a recognizable name for later list_templates calls. Use content.selector to crop to a specific element and give that element explicit dimensions for fixed-size images. For an exact browser viewport, set both viewport_width and viewport_height; this disables automatic cropping.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemNoOperation result. Check success before using this value.
errorNoError details when the operation failed; null on success.
successNoWhether the operation succeeded. If false, inspect error before retrying.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / content / properties / disable_twemoji / description
      Previous value: -"Use native Linux emoji rendering instead of HCTI's consistent Twemoji images. Leave `disable_twemoji` unset unless native emoji rendering is specifically needed."New value: +"Twemoji is enabled by default for images rendered from the template. Set `disable_twemoji: true` to disable automatic emoji replacement. Omitted, `null`, or `false` keeps Twemoji enabled."
  2. Changed5 schema fields changed
    • changedInput schema / properties / content / description
      Previous value: -"Template HTML, CSS, render options, name, and metadata. For fixed-size templates, use selector and give the selected element explicit dimensions."New value: +"Template HTML, optional CSS, name, description, and rendering defaults. Choose a recognizable name for later list_templates calls. Use content.selector to crop to a specific element and give that element explicit dimensions for fixed-size images. For an exact browser viewport, set both viewport_width and viewport_height; this disables automatic cropping."
    • addedInput schema / properties / content / properties / selector
      Added value: +{
      +  "description": "Crop the image to the element matching this CSS selector. Prefer a unique, stable ID such as `#card` when possible.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / error / description
      Added value: +"Error details when the operation failed; null on success."
    • addedOutput schema / properties / item / description
      Added value: +"Operation result. Check success before using this value."
    • addedOutput schema / properties / success / description
      Added value: +"Whether the operation succeeded. If false, inspect error before retrying."
  3. First observed

TDQS

A4.7/5.0
Behavior4/5

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

The description adds meaningful behavioral details beyond annotations: Handlebars substitutions are evaluated in HTML only, and the operation returns item.template_id and item.template_version. It also conveys the persistent side effect of saving a reusable template. No contradictions with annotations.

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?

Four sentences, each with a distinct job: state the resource and purpose, explain the placeholder mechanism, report return values, and route to alternatives. Every sentence earns its place with no filler.

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

Completeness5/5

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

The description covers the full create-then-render workflow, names the key return fields, and references the relevant sibling tools. Given the 100% schema coverage and the presence of an output schema, nothing needed for a correct call is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description adds parameter-relevant meaning by explaining the core placeholder mechanism ('Put Handlebars placeholders such as {{title}} in the HTML') and the HTML-only evaluation constraint. It also links the returned template_id to template_values usage in create_templated_image.

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?

The description opens with a specific verb and object: 'Saves a reusable HTML/CSS image template for rendering multiple images with different values.' It identifies the exact resource and purpose, and distinguishes itself from siblings by naming create_image, create_templated_image, and update_template.

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

Usage Guidelines5/5

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

It explicitly tells the agent when to use this tool versus alternatives: 'Call create_templated_image with that ID and template_values to render an image. Use create_image for a single image from supplied HTML/CSS, or update_template to revise an existing template.' This is clear, direct routing guidance with named alternatives.

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