Skip to main content
Glama

Upload Template

upload_template

Store a reusable document template from a local file, URL, or base64, then render it with its Template ID. Upload new versions of an existing template for repeatable document generation.

Instructions

Store a reusable template, then render it with render_document and its Template ID. Returns id (Template ID) and versionId. A new version of an existing template (id) is used by renders only once deployed (deployedAt).

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": {
      "template": "<template>"
    },
    "name": "upload_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoTemplate ID to add this upload to as a new version; omitted: a new template. Never a Version ID.
nameNoDisplay name, shown and searched by list_templates (max 200 characters).
tagsNoLabels, e.g. ["sales", "billing"]: sorted, deduplicated, 100 characters in all.
sampleNoA sample dataset stored with the template, at most one: [{ "data": { "name": "Acme" } }].
commentNoComment on this version (max 200 characters).
categoryNoCategory, e.g. "invoices" (max 200 characters).
expireAtNoDelete the template at this UTC Unix time (seconds); 0 (default) never. Until then, update_template_metadata with expireAt 0 cancels it. To delete now, use delete_template.
templateYesThe template file. An absolute local path ("/Users/me/report.docx", "~/report.docx"; a bare name like "report.docx" is read as base64), an HTTPS URL, or the file as base64. Formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, XML, SVG, IDML, MD, TXT, CSV, RTF, PDF; not the legacy binary DOC, XLS or PPT (re-save them as DOCX, XLSX, PPTX).
deployedAtNo42000000000 deploys this version now: renders by Template ID use the most recently deployed version. Earlier versions stay stored. update_template_metadata redeploys one.
versioningNoLeave true (default). false is legacy: no Template ID, only a SHA-256 templateId.

Output Schema

NameRequiredDescriptionDefault
idNoStable Template ID (when versioning is enabled).
nameNoTemplate display name, when one was given.
sizeNoTemplate size in bytes.
typeNoDetected template file type.
headersNorequestUploadUrl only: the headers to send with the file.
createdAtNoUTC Unix timestamp (seconds) of the upload.
expiresAtNorequestUploadUrl only: UTC Unix timestamp after which the URL is refused.
uploadUrlNorequestUploadUrl only: POST the file here as the raw body; the answer is the stored template. Nothing is stored before.
versionIdNoVersion ID (SHA-256) of this uploaded version.
deployedAtNoUTC Unix timestamp of deployment; 0 means this version is not explicitly deployed.
templateIdNoversioning: false only: the Version ID (SHA-256) of the upload, not a Template ID.
templateExtensionNoDetected file extension, e.g. "docx" (legacy/non-versioned mode).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv2.5.1
    • changedInput schema / properties / deployedAt / description
      Previous value: -"42000000000 deploys this version now: renders by Template ID use the most recently deployed version."New value: +"42000000000 deploys this version now: renders by Template ID use the most recently deployed version. Earlier versions stay stored. update_template_metadata redeploys one."
    • changedInput schema / properties / expireAt / description
      Previous value: -"Delete the template at this UTC Unix time (seconds); 0 (default) never. To delete now, use delete_template."New value: +"Delete the template at this UTC Unix time (seconds); 0 (default) never. Until then, update_template_metadata with expireAt 0 cancels it. To delete now, use delete_template."
    • changedInput schema / properties / id / description
      Previous value: -"Template ID (digits) to add this upload to as a new version; omitted: a new template. Never a Version ID."New value: +"Template ID to add this upload to as a new version; omitted: a new template. Never a Version ID."
    • addedInput schema / properties / id / maxLength
      Added value: +256
    • addedInput schema / properties / id / minLength
      Added value: +1
    • removedInput schema / properties / id / pattern
      Removed value: -"^\\d+$"
  2. Changed1 schema field changedv2.4.1
    • changedOutput schema / properties / uploadUrl / description
      Previous value: -"requestUploadUrl only: where to POST the file. The template does not exist yet."New value: +"requestUploadUrl only: POST the file here as the raw body; the answer is the stored template. Nothing is stored before."
  3. Changed22 schema fields changedv2.2.0
    • changedInput schema / properties / category / description
      Previous value: -"Group templates into folders/categories, max 200 characters (e.g. \"invoices\", \"legal\", \"hr\")."New value: +"Category, e.g. \"invoices\" (max 200 characters)."
    • changedInput schema / properties / comment / description
      Previous value: -"Free-text comment to describe the template version or its purpose, max 200 characters."New value: +"Comment on this version (max 200 characters)."
    • changedInput schema / properties / deployedAt / description
      Previous value: -"UTC Unix timestamp (seconds) to set as the deployment time for this version. Carbone uses the version with the most recent deployedAt when rendering via Template ID. Use 42000000000 to deploy immediately (special \"NOW\" sentinel value). Future values are not allowed."New value: +"42000000000 deploys this version now: renders by Template ID use the most recently deployed version."
    • removedInput schema / properties / deployedAt / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / deployedAt / minimum
      Removed value: --9007199254740991
    • changedInput schema / properties / expireAt / description
      Previous value: -"Schedule deletion at a UTC Unix timestamp (seconds); 0 (default) means the template never expires. After that time it is no longer listed, downloadable or renderable (404), and the file is purged after the retention delay. To remove a template now, use delete_template."New value: +"Delete the template at this UTC Unix time (seconds); 0 (default) never. To delete now, use delete_template."
    • removedInput schema / properties / expireAt / maximum
      Removed value: -9007199254740991
    • changedInput schema / properties / id / description
      Previous value: -"Existing Template ID (64-bit format) to add this upload to its version history. If omitted, a new Template ID is generated. Providing a Version ID (SHA-256) is not allowed and will cause an error."New value: +"Template ID (digits) to add this upload to as a new version; omitted: a new template. Never a Version ID."
    • addedInput schema / properties / id / pattern
      Added value: +"^\\d+$"
    • changedInput schema / properties / name / description
      Previous value: -"Display name for the template, max 200 characters (e.g. \"Invoice Template\", \"NDA Contract\"). Optional but recommended: list_templates shows it and its search matches it."New value: +"Display name, shown and searched by list_templates (max 200 characters)."
    • changedInput schema / properties / sample / description
      Previous value: -"Sample input data attached to the template for testing in Carbone Studio: an array with at most ONE object, whose keys data, complement, translations and enum are all optional. Example: [{ \"data\": { \"name\": \"Acme\" } }]."New value: +"A sample dataset stored with the template, at most one: [{ \"data\": { \"name\": \"Acme\" } }]."
    • removedInput schema / properties / sample / items / properties / complement / description
      Removed value: -"Extra data for {c.} tags."
    • removedInput schema / properties / sample / items / properties / data / description
      Removed value: -"JSON dataset for {d.} tags."
    • removedInput schema / properties / sample / items / properties / enum / description
      Removed value: -"Enumerations for :convEnum() formatter."
    • removedInput schema / properties / sample / items / properties / translations / description
      Removed value: -"Localization map for {t()} tags."
    • changedInput schema / properties / tags / description
      Previous value: -"Labels shown by list_tags and on each list_templates result (e.g. [\"sales\", \"billing\", \"v2\"]). Duplicates are removed and the list is sorted; the whole list is limited to 100 characters (about 8 tags of 9 characters)."New value: +"Labels, e.g. [\"sales\", \"billing\"]: sorted, deduplicated, 100 characters in all."
    • changedInput schema / properties / template / description
      Previous value: -"The template file. Three input forms are accepted: (1) Local file path — absolute, e.g. \"/Users/me/report.docx\" (or \"C:\\Users\\me\\report.docx\" on Windows), or under the home directory, e.g. \"~/report.docx\". A relative path must start with \"./\" or \"../\" and resolves against the server process's working directory, which is rarely yours: prefer an absolute path. A bare file name such as \"report.docx\" is NOT a path: it would be sent as base64 content. (2) HTTPS URL — the file is downloaded automatically, e.g. \"https://example.com/file.pptx\". (3) Base64-encoded string — the raw file content encoded as base64. Supported input formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, XML, SVG, IDML, MD, TXT, CSV, RTF, PDF. Carbone reads XML-based and text-based documents (plus PDF): the legacy binary Office formats DOC, XLS and PPT are rejected as input, although they are valid outputs. Re-save such a file as DOCX, XLSX or PPTX first."New value: +"The template file. An absolute local path (\"/Users/me/report.docx\", \"~/report.docx\"; a bare name like \"report.docx\" is read as base64), an HTTPS URL, or the file as base64. Formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, XML, SVG, IDML, MD, TXT, CSV, RTF, PDF; not the legacy binary DOC, XLS or PPT (re-save them as DOCX, XLSX, PPTX)."
    • changedInput schema / properties / versioning / description
      Previous value: -"Enable template versioning (default: true). When true, a stable Template ID is generated and multiple versions can be managed under it. When false, behaves as legacy mode and returns only a templateId (SHA-256 hash) and templateExtension."New value: +"Leave true (default). false is legacy: no Template ID, only a SHA-256 templateId."
    • addedOutput schema / properties / expiresAt
      Added value: +{
      +  "description": "requestUploadUrl only: UTC Unix timestamp after which the URL is refused.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / headers
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "requestUploadUrl only: the headers to send with the file.",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
    • changedOutput schema / properties / templateId / description
      Previous value: -"Template ID returned in legacy/non-versioned mode."New value: +"versioning: false only: the Version ID (SHA-256) of the upload, not a Template ID."
    • addedOutput schema / properties / uploadUrl
      Added value: +{
      +  "description": "requestUploadUrl only: where to POST the file. The template does not exist yet.",
      +  "type": "string"
      +}
  4. Changed3 schema fields changedv2.1.4
    • addedInput schema / properties / tags / items / maxLength
      Added value: +96
    • addedInput schema / properties / tags / items / minLength
      Added value: +1
    • addedInput schema / properties / tags / maxItems
      Added value: +100
  5. Changed24 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / category / description
      Previous value: -"Group templates into folders/categories (e.g. \"invoices\", \"legal\", \"hr\")."New value: +"Group templates into folders/categories, max 200 characters (e.g. \"invoices\", \"legal\", \"hr\")."
    • addedInput schema / properties / category / maxLength
      Added value: +200
    • changedInput schema / properties / comment / description
      Previous value: -"Free-text comment to describe the template version or its purpose."New value: +"Free-text comment to describe the template version or its purpose, max 200 characters."
    • addedInput schema / properties / comment / maxLength
      Added value: +200
    • changedInput schema / properties / deployedAt / description
      Previous value: -"UTC Unix timestamp (seconds) to set as the deployment time for this version. Carbone uses the version with the most recent deployedAt when rendering via Template ID. Use 42000000000 to deploy immediately (special \"NOW\" sentinel value)."New value: +"UTC Unix timestamp (seconds) to set as the deployment time for this version. Carbone uses the version with the most recent deployedAt when rendering via Template ID. Use 42000000000 to deploy immediately (special \"NOW\" sentinel value). Future values are not allowed."
    • changedInput schema / properties / expireAt / description
      Previous value: -"UTC Unix timestamp (seconds) at which this template will be automatically deleted. Use 42000000000 to delete immediately (special \"NOW\" sentinel value)."New value: +"Schedule deletion at a UTC Unix timestamp (seconds); 0 (default) means the template never expires. After that time it is no longer listed, downloadable or renderable (404), and the file is purged after the retention delay. To remove a template now, use delete_template."
    • changedInput schema / properties / expireAt / minimum
      Previous value: --9007199254740991New value: +0
    • changedInput schema / properties / name / description
      Previous value: -"Display name for the template (e.g. \"Invoice Template\", \"NDA Contract\")."New value: +"Display name for the template, max 200 characters (e.g. \"Invoice Template\", \"NDA Contract\"). Optional but recommended: list_templates shows it and its search matches it."
    • addedInput schema / properties / name / maxLength
      Added value: +200
    • changedInput schema / properties / sample / description
      Previous value: -"Sample input data attached to the template for testing in Carbone Studio. Each item must include data, complement, translations, and enum objects."New value: +"Sample input data attached to the template for testing in Carbone Studio: an array with at most ONE object, whose keys data, complement, translations and enum are all optional. Example: [{ \"data\": { \"name\": \"Acme\" } }]."
    • addedInput schema / properties / sample / items / additionalProperties
      Added value: +false
    • removedInput schema / properties / sample / items / required
      Removed value: -[
      -  "data",
      -  "complement",
      -  "translations",
      -  "enum"
      -]
    • addedInput schema / properties / sample / maxItems
      Added value: +1
    • changedInput schema / properties / tags / description
      Previous value: -"Tags for searchability and filtering (e.g. [\"sales\", \"billing\", \"v2\"])."New value: +"Labels shown by list_tags and on each list_templates result (e.g. [\"sales\", \"billing\", \"v2\"]). Duplicates are removed and the list is sorted; the whole list is limited to 100 characters (about 8 tags of 9 characters)."
    • changedInput schema / properties / template / description
      Previous value: -"The template file. Three input forms are accepted: (1) Local file path — absolute or relative, e.g. \"/home/user/report.docx\" or \"./invoice.xlsx\". (2) HTTPS URL — the file is downloaded automatically, e.g. \"https://example.com/file.pptx\". (3) Base64-encoded string — the raw file content encoded as base64. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.md"New value: +"The template file. Three input forms are accepted: (1) Local file path — absolute, e.g. \"/Users/me/report.docx\" (or \"C:\\Users\\me\\report.docx\" on Windows), or under the home directory, e.g. \"~/report.docx\". A relative path must start with \"./\" or \"../\" and resolves against the server process's working directory, which is rarely yours: prefer an absolute path. A bare file name such as \"report.docx\" is NOT a path: it would be sent as base64 content. (2) HTTPS URL — the file is downloaded automatically, e.g. \"https://example.com/file.pptx\". (3) Base64-encoded string — the raw file content encoded as base64. Supported input formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, XML, SVG, IDML, MD, TXT, CSV, RTF, PDF. Carbone reads XML-based and text-based documents (plus PDF): the legacy binary Office formats DOC, XLS and PPT are rejected as input, although they are valid outputs. Re-save such a file as DOCX, XLSX or PPTX first."
    • changedInput schema / properties / versioning / description
      Previous value: -"Enable template versioning (default: true). When true, a stable Template ID is generated and multiple versions can be managed under it. When false, behaves as legacy mode and returns only a templateId (SHA-256 hash)."New value: +"Enable template versioning (default: true). When true, a stable Template ID is generated and multiple versions can be managed under it. When false, behaves as legacy mode and returns only a templateId (SHA-256 hash) and templateExtension."
    • changedInput schema / required
      Previous value: -[
      -  "template",
      -  "name"
      -]New value: +[
      +  "template"
      +]
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / createdAt
      Added value: +{
      +  "description": "UTC Unix timestamp (seconds) of the upload.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / deployedAt
      Added value: +{
      +  "description": "UTC Unix timestamp of deployment; 0 means this version is not explicitly deployed.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / name / description
      Previous value: -"Template display name."New value: +"Template display name, when one was given."
    • addedOutput schema / properties / templateExtension
      Added value: +{
      +  "description": "Detected file extension, e.g. \"docx\" (legacy/non-versioned mode).",
      +  "type": "string"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "name"
      -]
  6. Changed1 schema field changedv1.6.0
    • changedInput schema / properties / template / description
      Previous value: -"The template file. Accepts a local file path (e.g. /home/user/invoice.docx), a URL (https://example.com/template.docx), or a base64-encoded string. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.md"New value: +"The template file. Three input forms are accepted: (1) Local file path — absolute or relative, e.g. \"/home/user/report.docx\" or \"./invoice.xlsx\". (2) HTTPS URL — the file is downloaded automatically, e.g. \"https://example.com/file.pptx\". (3) Base64-encoded string — the raw file content encoded as base64. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.md"
  7. Changed2 schema fields changedv1.2.2
    • changedInput schema / properties / template / description
      Previous value: -"The template file. Accepts a local file path (e.g. /home/user/invoice.docx), a URL (https://example.com/template.docx), or a base64-encoded string. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.html#output-file-type"New value: +"The template file. Accepts a local file path (e.g. /home/user/invoice.docx), a URL (https://example.com/template.docx), or a base64-encoded string. Supported formats: DOCX, XLSX, PPTX, ODT, ODS, ODP, ODG, HTML, XHTML, IDML, XML, Markdown (MD), PDF, and more. Full list: https://carbone.io/documentation/developer/http-api/generate-reports.md"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "id": {
      +      "description": "Stable Template ID (when versioning is enabled).",
      +      "type": "string"
      +    },
      +    "name": {
      +      "description": "Template display name.",
      +      "type": "string"
      +    },
      +    "size": {
      +      "description": "Template size in bytes.",
      +      "type": "number"
      +    },
      +    "templateId": {
      +      "description": "Template ID returned in legacy/non-versioned mode.",
      +      "type": "string"
      +    },
      +    "type": {
      +      "description": "Detected template file type.",
      +      "type": "string"
      +    },
      +    "versionId": {
      +      "description": "Version ID (SHA-256) of this uploaded version.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "name"
      +  ],
      +  "type": "object"
      +}
  8. First observedv1.1.2

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-idempotent, non-destructive, open-world behavior; the description adds the less obvious trait that appending a new version does not affect renders until deployment (deployedAt). It doesn't cover permissions, size limits, or failure modes for unsupported formats, which are left to the schema.

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 short sentences with zero filler; the core action and the returned identifiers come first, followed by the deployment caveat. Every clause carries information an agent needs.

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 mutation with full schema coverage and an output schema, the description covers the essential mental model: file in, id/versionId out, deploy to activate. Remaining gaps (expiry, tags, sample data, versioning flag) are handled adequately by the schema descriptions themselves.

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 baseline is 3. The description's comment about new versions being used by renders only once deployed largely restates the deployedAt parameter documentation, adding little beyond what the schema already says about id, versioning, and the deploy magic value.

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 ('Store a reusable template') and immediately names the downstream sibling (render_document) and the identifier it produces (Template ID). An agent can distinguish this from list_templates, update_template_metadata, or delete_template without opening any 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 a clear context: use this to create a template that render_document will consume, and pass the returned id to update_template_metadata flows for redeployment. It does not state exclusions or prerequisites explicitly (e.g., when to prefer convert_document, or auth requirements), so it stops short of a full when/when-not statement.

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