Skip to main content
Glama

Render document to a file

render
Idempotent

Generate LaTeX, Markdown, JSON, or text source files from registered template documents for PDF compilation or review, applying a selected build mode and writing to the cache.

Instructions

Render a registered template-driven document to a file on disk.

    Purpose:
    Materializes document templates into concrete source files (LaTeX, Markdown, JSON, text)
    under `build/.cache/rendered/` applying the specified build mode.

    When to use:
    - When generating LaTeX source for PDF compilation and accessibility tagging.
    - When generating Markdown or text representations for review or downstream processing.

    When NOT to use:
    - Do NOT use without discovering valid `doc_id` values first using `list_docs`.
    - Do NOT use to compile PDFs directly; this tool produces rendered sources for compilation.

    Behavioral transparency:
    Non-destructive, idempotent cache writer. Regenerates files under `build/.cache/rendered/`
    without modifying template sources or `data/meta.yaml`.

    Returns:
    Dictionary containing doc_id, format, build mode, output_path, and byte size.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fmtNoOutput format the document is rendered to. Must be exactly one of: 'json', 'latex', 'markdown', 'text' (see `render`'s docstring / `list_docs`).latex
modeNoBuild mode / profile applied when rendering. Must be exactly one of: 'camera-ready', 'draft', 'submission'.draft
doc_idYesRegistered template document id — see `list_docs`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / fmt / description
      Previous value: -"Output format: one of `latex`, `markdown`, `json`, `text`."New value: +"Output format the document is rendered to. Must be exactly one of: 'json', 'latex', 'markdown', 'text' (see `render`'s docstring / `list_docs`)."
    • addedInput schema / properties / fmt / enum
      Added value: +[
      +  "json",
      +  "latex",
      +  "markdown",
      +  "text"
      +]
    • changedInput schema / properties / mode / description
      Previous value: -"Render mode: one of `draft`, `submission`, `camera-ready`."New value: +"Build mode / profile applied when rendering. Must be exactly one of: 'camera-ready', 'draft', 'submission'."
    • addedInput schema / properties / mode / enum
      Added value: +[
      +  "camera-ready",
      +  "draft",
      +  "submission"
      +]
  2. Changed3 schema fields changedv0.0.9
    • addedInput schema / properties / doc_id / description
      Added value: +"Registered template document id — see `list_docs`."
    • addedInput schema / properties / fmt / description
      Added value: +"Output format: one of `latex`, `markdown`, `json`, `text`."
    • addedInput schema / properties / mode / description
      Added value: +"Render mode: one of `draft`, `submission`, `camera-ready`."
  3. First observedv0.0.7

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare idempotentHint, destructiveHint=false, and readOnlyHint=false; the description goes further by pinpointing the write target ('build/.cache/rendered/') and asserting template sources and data/meta.yaml are untouched. It adds real context beyond the annotations, though it restates the idempotency/non-destructiveness already encoded.

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?

Labelled sections make it easy to scan and the core action is front-loaded in the first sentence. It is somewhat long and the 'Returns' block is arguably redundant given the output schema, but no sentence is pure filler.

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 3-param write tool with an output schema already defined, the description covers purpose, prerequisites (discover doc_id via list_docs), exclusions, and side effects (cache-only writes). Nothing essential is missing, though the return-value section duplicates the output schema.

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 all three parameters (fmt, mode, doc_id) are already documented with enums and defaults in the schema. The description repeats the formats and mentions 'specified build mode' but adds no new syntax or constraint beyond the structured fields, matching the baseline of 3.

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 ('Render a registered template-driven document to a file on disk') and names the concrete outputs (LaTeX, Markdown, JSON, text) plus the destination directory. It is clearly distinguishable from siblings like list_docs, audit_pdf, and doc_count.

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?

Explicit 'When to use' and 'When NOT to use' sections name the sibling to consult first ('list_docs') and warn against using it for PDF compilation. Alternatives and exclusions are stated, not inferred.

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

Deploy Server

Other Tools