Skip to main content
Glama

Download Template

download_template

Retrieve a stored template's original file by ID, or return its saved sample dataset as JSON when requested; text and images come inline, other files save to a temp path.

Instructions

Download a stored template's original file (DOCX, XLSX, HTML...), or with sample: true the sample dataset stored with it. Text and images come back inline; other files are saved to a temp file whose path is returned.

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": "download_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
sampleNoIf true, return the sample dataset stored at upload, as JSON, instead of the file; an error if there is none.
outputPathNoLocal path to save the template file to, e.g. "~/out.pdf"; returns the path and size. Never overwrites a file.
templateIdYesTemplate ID (its deployed version) or Version ID, from list_templates.
asAttachmentNoIf true, return a text or image file as a base64 attachment too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.1
    • addedInput schema / properties / templateId / maxLength
      Added value: +256
  2. Changed4 schema fields changedv2.2.0
    • changedInput schema / properties / asAttachment / description
      Previous value: -"If true, return the template as a downloadable file attachment (base64 resource) instead of inline text/image. Useful in HTTP mode where outputPath is unavailable. Default: false. Ignored when outputPath is set."New value: +"If true, return a text or image file as a base64 attachment too."
    • changedInput schema / properties / outputPath / description
      Previous value: -"Optional local file path to save the template file to (e.g. \"/home/user/out.pdf\" or \"~/out.pdf\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the document inline — ideal for large files. The path must not exist yet: an existing file is never overwritten (the call fails and asks for a new file name)."New value: +"Local path to save the template file to, e.g. \"~/out.pdf\"; returns the path and size. Never overwrites a file."
    • changedInput schema / properties / sample / description
      Previous value: -"If true, download the JSON SAMPLE DATASET saved with the template (the \"sample\" array passed to upload_template) instead of the template file, returned as inline JSON text by default, of the form [{ \"data\": {...}, \"complement\": {...}, \"translations\": {...}, \"enum\": {...} }] (each key optional). Use it to recover the example data a template expects before calling render_document. Errors if the template was uploaded without a sample."New value: +"If true, return the sample dataset stored at upload, as JSON, instead of the file; an error if there is none."
    • changedInput schema / properties / templateId / description
      Previous value: -"Template ID (64-bit) or Version ID (SHA-256) to download. Template ID — downloads the currently deployed version of the template. Version ID — downloads that exact version regardless of deployment status. Both formats are returned by upload_template and list_templates."New value: +"Template ID (its deployed version) or Version ID, from list_templates."
  3. Changed3 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 / outputPath / description
      Previous value: -"Optional local file path to save the template file to (e.g. \"/home/user/out.pdf\" or \"~/out.pdf\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the document inline — ideal for large files."New value: +"Optional local file path to save the template file to (e.g. \"/home/user/out.pdf\" or \"~/out.pdf\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the document inline — ideal for large files. The path must not exist yet: an existing file is never overwritten (the call fails and asks for a new file name)."
    • changedInput schema / properties / sample / description
      Previous value: -"If true, download the JSON SAMPLE DATASET saved with the template (the \"sample\" array passed to upload_template) instead of the template file. Returns JSON of the form [{ \"data\": {...}, \"complement\": {...}, \"translations\": {...}, \"enum\": {...} }]. Use it to recover the example data a template expects — handy before calling render_document against an unfamiliar template. Errors if the template was uploaded without a sample."New value: +"If true, download the JSON SAMPLE DATASET saved with the template (the \"sample\" array passed to upload_template) instead of the template file, returned as inline JSON text by default, of the form [{ \"data\": {...}, \"complement\": {...}, \"translations\": {...}, \"enum\": {...} }] (each key optional). Use it to recover the example data a template expects before calling render_document. Errors if the template was uploaded without a sample."
  4. Changed2 schema fields changedv1.6.0
    • changedInput schema / properties / outputPath / description
      Previous value: -"Optional local file path to save the template file to (e.g. \"/home/user/template.docx\" or \"~/template.docx\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the file inline. Local (stdio) mode only; rejected in HTTP mode."New value: +"Optional local file path to save the template file to (e.g. \"/home/user/out.pdf\" or \"~/out.pdf\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the document inline — ideal for large files."
    • addedInput schema / properties / sample
      Added value: +{
      +  "description": "If true, download the JSON SAMPLE DATASET saved with the template (the \"sample\" array passed to upload_template) instead of the template file. Returns JSON of the form [{ \"data\": {...}, \"complement\": {...}, \"translations\": {...}, \"enum\": {...} }]. Use it to recover the example data a template expects — handy before calling render_document against an unfamiliar template. Errors if the template was uploaded without a sample.",
      +  "type": "boolean"
      +}
  5. Changed2 schema fields changedv1.2.2
    • addedInput schema / properties / asAttachment
      Added value: +{
      +  "description": "If true, return the template as a downloadable file attachment (base64 resource) instead of inline text/image. Useful in HTTP mode where outputPath is unavailable. Default: false. Ignored when outputPath is set.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / outputPath
      Added value: +{
      +  "description": "Optional local file path to save the template file to (e.g. \"/home/user/template.docx\" or \"~/template.docx\"). When set, the file is written to disk and the tool returns the saved path + size instead of embedding the file inline. Local (stdio) mode only; rejected in HTTP mode.",
      +  "type": "string"
      +}
  6. First observedv1.1.2

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only declare the safety profile (readOnly=false, destructive=false, idempotent=false); the description adds genuinely new behavior: text and images return inline, other file types land in a temp file whose path is returned, and sample mode errors if no sample exists. That explains the return mechanics and the non-idempotent, write-touching nature without contradicting the hints.

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?

Two sentences, zero filler, and the primary purpose plus the sample-mode branch are front-loaded. Every clause carries information an agent needs to pick a mode.

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 4-parameter read tool with no output schema and full schema coverage, the description covers modes and return shapes adequately. Remaining gaps (error behavior beyond missing samples, whether asAttachment affects the temp-file path) are modest.

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 earns more by explaining the default branch behavior (no outputPath → other files go to a temp file and the path is returned), which the schema does not state. It still says nothing about asAttachment or how sample interacts with outputPath.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb+resource: 'Download a stored template's original file (DOCX, XLSX, HTML...)' with the sample-mode variant spelled out. It clearly separates file mode from sample-dataset mode, but never contrasts itself with siblings like inspect_template or render_document, so a reader must infer the boundary.

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

Usage Guidelines3/5

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

Usage is implied by the two modes ('or with sample: true the sample dataset stored with it'), but there is no explicit when-to-use-this-vs-alternative guidance and no when-not conditions. The agent must reason that this is for retrieving files rather than inspecting or rendering them.

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