Skip to main content
Glama

Create a template

create_template

Create a new template at version 1 from an HTML document with Liquid expressions, plus a JSON Schema for its data. Use this when nothing in list_templates fits. The name must be free on this account — publishing a change to an existing template is update_template, not this. Free, but each plan keeps a limited number of templates of your own (the starter library never counts): at the limit this returns plan_required with how many the account has, and update_template still works.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTemplate name: lowercase letters, digits, dot, dash or underscore, 1-63 characters. Unique per account. Versions are separate — do not put `@1` here.
engineNoRendering engine. `chromium` (default) is full HTML and CSS and is required for PDF. `satori` is a fast PNG path for simple flexbox card layouts — no page breaks, no floats, no external CSS — and costs us less, so prefer it for OG images and social cards.
schemaNoJSON Schema (2020-12) for the `data` payload this template accepts. Strongly recommended: it is what turns a bad payload into a field-level error with a path, an expected type and a working example instead of a blank page. Use `required` and give each property a `description`.
sourceYesOne self-contained HTML document with inline CSS and Liquid expressions (`{{ customer.name }}`, `{% for line in line_items %}`). No file includes: everything the render needs must be in this string, or at a public https URL. Two extra filters ship by default: `money` and `date_medium`. For a PDF, use `@page { size: Letter; margin: 18mm }` to control pagination.
exampleNoA payload that renders correctly. It is echoed back in validation errors, so include one.
messageNoChange note for this version, like a commit message.
optionsNoRender options, merged over the template's own defaults. Options are part of the cache key, so two calls that differ only here are two different renders.
descriptionNoOne line on what this template is for. Shown in list_templates.
expected_pagesNoHow many PDF pages a typical payload renders. Default 1. This is the estimate the free tier and the spend cap are checked against before the render starts, so a template that runs to several pages must say so or a render that cannot fit the allowance will be started and then go over. It is not a limit: the render is billed on the pages it actually produced.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / options / properties / margin / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "properties": {
      -      "bottom": {
      -        "type": "string"
      -      },
      -      "left": {
      -        "type": "string"
      -      },
      -      "right": {
      -        "type": "string"
      -      },
      -      "top": {
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "properties": {
      +      "bottom": {
      +        "type": [
      +          "string",
      +          "number"
      +        ]
      +      },
      +      "left": {
      +        "type": [
      +          "string",
      +          "number"
      +        ]
      +      },
      +      "right": {
      +        "type": [
      +          "string",
      +          "number"
      +        ]
      +      },
      +      "top": {
      +        "type": [
      +          "string",
      +          "number"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  }
      +]
    • changedInput schema / properties / options / properties / margin / description
      Previous value: -"PDF margins, CSS lengths: `18mm`, or per side."New value: +"PDF margins, CSS lengths in `in`, `px`, `cm` or `mm`: `18mm`, or per side. A bare number is px."
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already signal a non-read, non-idempotent operation; the description adds useful behavioral context beyond them: templates start at version 1, the name must be free on the account, and at the plan limit the call returns plan_required with the account count. It does not detail authentication needs or the success response, but the error behavior is a meaningful extra.

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 dense sentences with no filler: definition, selection rule, and plan-limit constraint are all front-loaded and each earns its place.

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 9-parameter tool with nested options and no output schema, the description plus fully documented schema covers invocation well: uniqueness, versioning, sibling routing, and plan-limit error. It does not say what a successful create returns (e.g. template ID/object), which an agent might need for downstream renders, so it is not fully complete.

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 the schema already documents every parameter. The description mentions HTML/Liquid and JSON Schema at a high level but adds no parameter-specific semantics beyond what the input schema provides; baseline 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 operation ('Create a new template at version 1') with the exact input materials (HTML with Liquid plus JSON Schema), and explicitly distinguishes it from update_template. An agent can tell what this tool does and what it is not for.

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?

Gives a clear selection rule: use when nothing in list_templates fits, and states the condition for the sibling (publishing a change to an existing template is update_template). It also covers the plan-limit edge case and says update_template still works at the limit.

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