Skip to main content
Glama

hedwigai

Render a document to PDF

render_document
Idempotent

Compiles a document you wrote — LaTeX, Typst or Markdown — to a PDF, files it in this account's own storage, and returns a link the user can open (it lasts about six days).

latex is real TeX (Tectonic, XeTeX underneath): journal and conference classes such as IEEEtran, acmart and elsarticle set the page as they would on the author's machine, and BibTeX bibliographies are built. The source is the main .tex; put the rest of the project — chapters, a refs.bib, a .cls — in files, and images either as base64 in files or as assets URLs. Shell escape is off, so minted does not run (use listings); biber is not available (use BibTeX). The first compile of a rarely used package can take a minute while it is fetched.

typst is a complete Typst document; packages from Typst Universe (#import "@preview/…") work. markdown is set in a clean report style, with LaTeX maths in $…$ and $$…$$.

If the source does not compile, the compiler's own message comes back — for LaTeX, the line that failed: fix the source and call again.

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": {
      "format": "<format>",
      "source": "<source>"
    },
    "name": "render_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoA file name for the PDF, without extension, e.g. 'thesis-chapter-2'. Optional.
filesNoLaTeX only: the rest of the project beside the main file. Each {path, text} for a .tex, .bib, .cls or .sty, or {path, base64} for an image or other binary file. Paths are relative, as the source refers to them, e.g. chapters/intro.tex or figures/plot.png.
assetsNoFiles the source refers to by relative path, fetched before compiling (latex or typst). Each {url, path}: a public https URL and the path the source uses, e.g. {"url": "https://example.org/plot.png", "path": "figures/plot.png"}.
formatYeslatex, typst or markdown.
sourceYesThe whole document, as text — for latex, the main .tex file.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / context
      Removed value: -{
      -  "description": "Explain in 15-25 words, in third person, why this tool is called and how it supports the user's goal. For analytics only. You MUST describe only the abstract purpose of the tool call. NEVER include, repeat, paraphrase, or infer personal, sensitive, or identifying information from the user request or tool results, including names, emails, phone numbers, IPs, IDs, or credentials. You MUST generalize specific entities into roles such as \"a user\", \"the customer\", or \"an account\". Example: \"Retrieving a customer's recent orders to investigate a billing issue and help support determine the appropriate resolution.\"",
      -  "type": "string"
      -}
    • removedInput schema / properties / llm_model
      Removed value: -{
      -  "description": "The exact model identifier you (the assistant) are running as, taken from your system prompt or environment (e.g. \"claude-opus-4-8\", \"gpt-5.2\"). Used for analytics only. If you do not know your model identifier with certainty, pass \"unknown\" — never guess.",
      -  "type": "string"
      -}
  2. Changed5 schema fields changed
    • changedInput schema / properties / assets / description
      Previous value: -"Files the source refers to by relative path, fetched before compiling (Typst only). Each {url, path}: a public https URL and the path the source uses, e.g. {\"url\": \"https://example.org/plot.png\", \"path\": \"figures/plot.png\"}."New value: +"Files the source refers to by relative path, fetched before compiling (latex or typst). Each {url, path}: a public https URL and the path the source uses, e.g. {\"url\": \"https://example.org/plot.png\", \"path\": \"figures/plot.png\"}."
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "LaTeX only: the rest of the project beside the main file. Each {path, text} for a .tex, .bib, .cls or .sty, or {path, base64} for an image or other binary file. Paths are relative, as the source refers to them, e.g. chapters/intro.tex or figures/plot.png.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "base64": {
      +        "description": "The file's bytes, base64, for a binary file.",
      +        "type": "string"
      +      },
      +      "path": {
      +        "description": "Relative path inside the project.",
      +        "type": "string"
      +      },
      +      "text": {
      +        "description": "The file's text.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / format / description
      Previous value: -"typst or markdown."New value: +"latex, typst or markdown."
    • changedInput schema / properties / format / enum
      Previous value: -[
      -  "typst",
      -  "markdown"
      -]New value: +[
      +  "latex",
      +  "typst",
      +  "markdown"
      +]
    • changedInput schema / properties / source / description
      Previous value: -"The whole document, as text."New value: +"The whole document, as text — for latex, the main .tex file."
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare the write/open-world/idempotent profile, and the description adds substantial context on top: the returned link lasts about six days, output is filed in the account's own storage, shell escape is disabled (minted will not run) and biber is unavailable, and rare package fetches can add a minute of latency. It also explains the failure mode — the compiler's own message with the failing line for LaTeX — so the agent knows how to retry.

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?

The core action and return value are front-loaded in the first sentence, then failure behavior, then per-format detail — a sensible structure. It is dense but nearly every sentence carries operative information; only a few phrases restate what the schema already says.

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 tool with no output schema, the description covers the return value (a link valid roughly six days), the storage side effect, latency expectations, and errors. Combined with a fully documented input schema, an agent has everything needed to invoke it and interpret results.

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, but the description earns above that by adding real meaning: `source` is the main .tex file for LaTeX, `files` carries the rest of the project (chapters, refs.bib, .cls), and `assets` are fetched from public URLs before compiling. Those relationships between parameters are not fully expressed in the schema alone.

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 precise verb and resource chain — compile a LaTeX/Typst/Markdown document to PDF, file it in account storage, return a link — so an agent knows exactly what the tool produces and where the artifact lives. It is clearly distinct from sibling tools like bash or upload, which do not render documents.

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 clear per-format guidance by describing what each of `latex`, `typst` and `markdown` accepts and produces, which effectively tells the agent which format value to pick for a given source. It never names an alternative tool or states when not to use this one, so it stops short of full when/when-not routing.

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.