Skip to main content
Glama

Render template

render_template

Create a PDF from a stored template (a curated makesPDF library template or one the user saved) filled with the user's data. Use when the user asks for a PDF of a structured document, such as an invoice, receipt, quote, certificate or resume, that a template covers. Uses the user's makesPDF credits: 1 credit per 10 pages. Returns JSON metadata (pageCount, creditsDeducted, creditsRemaining, artifactId, downloadUrl) plus the PDF bytes as an embedded base64 resource and a resource_link to downloadUrl. On the Free and Hobbyist plans, unless the account holds Growth credits, each page carries a small makespdf.com link. Mirrors POST /api/v1/render with the { templateId, data } body shape.

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": {
      "templateId": "<templateId>"
    },
    "name": "render_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoBinding data substituted into {{var}} expressions. When omitted, the `const sampleData` declared inside the template's DSL is used; the separately stored sampleData field is not.
titleNoDocument title written to the PDF metadata. PDF viewers show it in the window title instead of the file name. When omitted, the template's saved name is used; a title set in the DSL's doc() is not.
templateIdYesTemplate ID — slug for library rows (e.g. 'invoice-classic') or UUID for user rows.

Output Schema

NameRequiredDescriptionDefault
renderMsYesServer-side render time in milliseconds.
pageCountYesPages in the rendered PDF.
sizeBytesYesSize of the PDF in bytes.
artifactIdNoID of the stored render artifact, also served at GET /api/v1/artifacts/{id}/pdf. Absent when the artifact could not be recorded.
templateIdYesTemplate ID: a slug for library templates, a UUID for your own.
downloadUrlNoShort-lived signed URL that downloads the rendered PDF with no credential of its own. Absent when the artifact could not be recorded.
creditsDeductedYesCredits charged for this render: 1 per 10 pages, rounded up; 0 when the caller is not billed.
creditsRemainingYesCredit balance after the charge; null when the caller is not billed.
templateWarningsYesProblems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart. Each originates in the DSL or the data.
downloadUrlExpiresAtNoWhen `downloadUrl` stops working, as an ISO 8601 timestamp.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / downloadUrl
      Added value: +{
      +  "description": "Short-lived signed URL that downloads the rendered PDF with no credential of its own. Absent when the artifact could not be recorded.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / downloadUrlExpiresAt
      Added value: +{
      +  "description": "When `downloadUrl` stops working, as an ISO 8601 timestamp.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedOutput schema / properties / artifactId / description
      Previous value: -"ID of the stored render artifact; pass it to report_feedback or download it again via GET /api/v1/artifacts/{id}/pdf. Absent when the artifact could not be recorded."New value: +"ID of the stored render artifact, also served at GET /api/v1/artifacts/{id}/pdf. Absent when the artifact could not be recorded."
    • changedOutput schema / properties / templateWarnings / description
      Previous value: -"Problems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart; fix them in the DSL or the data."New value: +"Problems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart. Each originates in the DSL or the data."
  3. Changed2 schema fields changed
    • changedInput schema / properties / title / description
      Previous value: -"Document title written to the PDF metadata. PDF viewers show it in the window title instead of the file name."New value: +"Document title written to the PDF metadata. PDF viewers show it in the window title instead of the file name. When omitted, the template's saved name is used; a title set in the DSL's doc() is not."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Render and billing metadata. The PDF itself is the embedded resource in `content`.",
      +  "properties": {
      +    "artifactId": {
      +      "description": "ID of the stored render artifact; pass it to report_feedback or download it again via GET /api/v1/artifacts/{id}/pdf. Absent when the artifact could not be recorded.",
      +      "type": "string"
      +    },
      +    "creditsDeducted": {
      +      "description": "Credits charged for this render: 1 per 10 pages, rounded up; 0 when the caller is not billed.",
      +      "type": "integer"
      +    },
      +    "creditsRemaining": {
      +      "description": "Credit balance after the charge; null when the caller is not billed.",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "pageCount": {
      +      "description": "Pages in the rendered PDF.",
      +      "type": "integer"
      +    },
      +    "renderMs": {
      +      "description": "Server-side render time in milliseconds.",
      +      "type": "integer"
      +    },
      +    "sizeBytes": {
      +      "description": "Size of the PDF in bytes.",
      +      "type": "integer"
      +    },
      +    "templateId": {
      +      "description": "Template ID: a slug for library templates, a UUID for your own.",
      +      "type": "string"
      +    },
      +    "templateWarnings": {
      +      "description": "Problems found while binding data (unsupported expressions, unknown filters, bad currency codes, invalid chart data, …). Unresolved expressions render as empty text and bad chart data affects the chart; fix them in the DSL or the data.",
      +      "items": {
      +        "properties": {
      +          "code": {
      +            "description": "Warning kind, e.g. 'unknown-filter'.",
      +            "type": "string"
      +          },
      +          "detail": {
      +            "description": "Human-readable explanation, when available.",
      +            "type": "string"
      +          },
      +          "expression": {
      +            "description": "The expression source that failed.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "expression"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "templateId",
      +    "pageCount",
      +    "sizeBytes",
      +    "renderMs",
      +    "creditsDeducted",
      +    "creditsRemaining",
      +    "templateWarnings"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • changedInput schema / properties / data / description
      Previous value: -"Binding data substituted into {{var}} expressions. Falls back to the template's sampleData when omitted."New value: +"Binding data substituted into {{var}} expressions. When omitted, the `const sampleData` declared inside the template's DSL is used; the separately stored sampleData field is not."
    • changedInput schema / properties / title / description
      Previous value: -"Optional document title (shown in PDF metadata)."New value: +"Document title written to the PDF metadata. PDF viewers show it in the window title instead of the file name."
  5. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare the broad safety profile (non-read-only, non-destructive, open-world, non-idempotent); the description goes well beyond them by disclosing the billing model (1 credit per 10 pages), the plan-dependent makespdf.com watermark on Free and Hobbyist accounts, and the exact success payload. It also states it mirrors POST /api/v1/render, giving a developer a concrete reference for side effects.

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

Conciseness4/5

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

Purpose and the when-to-use trigger are front-loaded in the first two sentences, followed by cost, return value, and plan caveats in a logical order. The trailing 'Mirrors POST /api/v1/render with the { templateId, data } body shape' is largely redundant with the schema and is the one sentence that does not earn its place.

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?

For a three-parameter, mutation-adjacent rendering tool with credit consumption, the description covers trigger, cost, plan-dependent watermarking, and output shape. An output schema exists, so enumerating return fields is technically surplus, but it does not leave any gap an agent would need to guess at.

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 coverage is 100% and the schema descriptions already explain data binding, title precedence, and templateId slug-vs-UUID semantics in more detail than the description. The description only adds the aggregate body shape '{ templateId, data }', which restates rather than extends the schema, so the baseline of 3 is appropriate.

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 concrete verb and resource — 'Create a PDF from a stored template' — and qualifies the template source (makesPDF library slug vs. a user-saved template), which maps directly onto the templateId slug/UUID distinction. It is clearly separable from render_markdown or render_dsl_preview because it names the precondition that a stored template must exist.

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?

It gives an explicit trigger ('when the user asks for a PDF of a structured document') with concrete examples (invoice, receipt, quote, certificate, resume) and the gating condition 'that a template covers'. It stops short of naming an alternative tool for the case where no template covers the document, leaving that inference to the agent.

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