Skip to main content
Glama

HTML/CSS to Image API

Update a Template

update_template
Destructive

Updates an existing HTML/CSS image template. Replaces its latest version when that version has not been rendered; otherwise creates a new version. Returns item.template_id and item.template_version. Call create_templated_image with the returned ID and version to render the updated design. Use list_template_versions to inspect existing content before replacing it.

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": {
      "content": "<content>",
      "template_id": "<template_id>"
    },
    "name": "update_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesComplete replacement content for the template. Preserve intentional variable names and render dimensions unless the user requests a change.
template_idYesThe exact template ID to update.

Output 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. Changed3 schema fields changed
    • changedInput schema / properties / content / properties / device_scale / description
      Previous value: -"Screenshot pixel ratio from `0.1` to `3`. Higher values increase output dimensions, file size, and render time. Minimum: 0.1. Maximum: 3. HTML and template renders default to 2; URL renders default to 1."New value: +"Capture pixel ratio from `0.1` to `3`. Higher values increase output dimensions, file size, and render time. Minimum: 0.1. Maximum: 3. HTML and template renders default to 2; URL renders default to 1."
    • changedInput schema / properties / content / properties / viewport_height / description
      Previous value: -"Viewport height in pixels. Set it together with `viewport_width` only when an exact browser viewport is needed; doing so disables automatic cropping. Minimum: 1. Maximum: 6000. Both viewport dimensions must be supplied together."New value: +"Viewport height in pixels. Set it together with `viewport_width` only when an exact browser viewport is needed; for screenshots, doing so disables automatic cropping. Minimum: 1. Maximum: 6000. Both viewport dimensions must be supplied together."
    • changedInput schema / properties / content / properties / viewport_width / description
      Previous value: -"Viewport width in pixels. Set it together with `viewport_height` only when an exact browser viewport is needed; doing so disables automatic cropping. Minimum: 1. Maximum: 6000. Both viewport dimensions must be supplied together."New value: +"Viewport width in pixels. Set it together with `viewport_height` only when an exact browser viewport is needed; for screenshots, doing so disables automatic cropping. Minimum: 1. Maximum: 6000. Both viewport dimensions must be supplied together."
  2. Changed1 schema field changed
    • addedInput schema / properties / content / properties / pdf_options
      Added value: +{
      +  "description": "Options used when generating a PDF instead of an image. Page dimensions and margins must include supported PDF units; margins must contain either zero or four values; scale must be between 0.1 and 2.",
      +  "properties": {
      +    "margins": {
      +      "description": "Margins of the webpage rendering. Defaults to 0. 4 values must be supplied: top, right, bottom, left. Units are px, cm, in, mm, or pt.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "page_height": {
      +      "description": "Height of the page, with unit (px, in, cm, mm, pt)",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "page_width": {
      +      "description": "Width of the page, with unit (px, in, cm, mm, pt)",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "print_background": {
      +      "description": "Print background graphics.",
      +      "type": "boolean"
      +    },
      +    "scale": {
      +      "description": "Scale of the webpage rendering. Defaults to 1.",
      +      "maximum": 2,
      +      "minimum": 0.1,
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / content / properties / request_overrides
      Added value: +{
      +  "description": "An array of request rules. Use `action: \"block\"` with a `url` wildcard pattern (using `*`) and/or `resource_types` as an array of resource names, such as `image`, `script`, or `xhr`. Both matchers must match when supplied together; any matching block rule blocks the request. Omitted, `null`, or `[]` adds no overrides. Requires a paid plan. Accepts a JSON array in JSON requests or a JSON-encoded array string in form requests. Maximum 100 rules and 512 characters per URL pattern. Each block rule requires a nonempty URL pattern or at least one resource type; supplied matchers cannot be empty.",
      +  "items": {
      +    "anyOf": [
      +      {
      +        "properties": {
      +          "action": {
      +            "const": "block"
      +          },
      +          "resource_types": {
      +            "description": "Resource types to match, supplied as an array of names, such as image, script, xhr, or fetch. Any listed type may match. When url is also supplied, it must match too.",
      +            "items": {
      +              "enum": [
      +                "beacon",
      +                "document",
      +                "stylesheet",
      +                "image",
      +                "image_set",
      +                "media",
      +                "font",
      +                "script",
      +                "text_track",
      +                "xhr",
      +                "fetch",
      +                "event_source",
      +                "manifest",
      +                "ping",
      +                "img",
      +                "other"
      +              ],
      +              "type": "string"
      +            },
      +            "type": [
      +              "array",
      +              "null"
      +            ]
      +          },
      +          "url": {
      +            "description": "URL wildcard pattern to match, using * for any sequence of characters. When resource_types is also supplied, both matchers must match.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        }
      +      }
      +    ],
      +    "description": "A browser request override. The action discriminator selects the rule type; currently only block is supported.",
      +    "required": [
      +      "action"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  4. 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."
  5. Changed4 schema fields changed
    • 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."
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the non-obvious branching rule: it replaces the latest version when that version has not been rendered, otherwise it creates a new version. The annotations already flag destructiveHint=true and idempotentHint=false, but the description does not explicitly warn that the unrendered latest version's content is overwritten, and does not address repeated-call idempotency directly.

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 short sentences, front-loaded with the primary action and versioning rule, followed by return values and next-step routing. Every sentence carries information an agent would otherwise have to infer.

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?

Output schema exists, yet the description still names the returned fields, and it explains the version-selection behavior that the schema cannot express. Combined with the fully described nested parameter schema, nothing needed to call this tool correctly is missing.

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?

Schema description coverage is 100%, so both top-level parameters and all nested content fields are already documented in the schema. The description repeats the 'complete replacement content' notion from the schema but adds no format, syntax, or defaulting guidance beyond it, so the baseline of 3 applies.

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 ("Updates an existing HTML/CSS image template") and immediately distinguishes itself from create_template and list_template_versions by describing the version-replacement behavior. An agent can tell it apart from the other template tools without opening a schema.

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 concrete routing: use list_template_versions to inspect existing content before replacing it, and call create_templated_image with the returned ID and version to render. It does not explicitly contrast with create_template (new template vs. existing), which is the one obvious sibling decision left implicit.

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.