Skip to main content
Glama

API Keg — PDF Forge & Layout Diagnostics

Render Markdown or HTML Document to Themed PDF

render_document_pdf
Read-onlyIdempotent

Compiles Markdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or HTML into both print-ready themed HTML and a spec-compliant multi-page PDF 1.7 binary with running headers, 'Page X of Y' footers, repeated table headers across page breaks, optional watermark, and deterministic layoutDiagnostics. Pricing: $0.004 USD per rendered PDF document (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.

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": {
      "content": "<content>"
    },
    "name": "render_document_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
themeNoCorporate print styling theme ('executive', 'invoice', 'technical', or 'memo').executive
titleNoOptional document title rendered in the cover banner and stored in PDF /Title metadata.
authorNoOptional author or organization name rendered in the cover banner and PDF /Author metadata.
contentYesMarkdown (headings, bold/italic/code, lists, GFM tables, callouts, '---pagebreak---') or raw HTML body to compile.
pageSizeNoPaper size ('Letter', 'A4', or 'Legal').Letter
subtitleNoOptional subtitle rendered below the title and stored in PDF /Subject metadata.
headerTextNoOptional running header stamped at the top margin of every page.
orientationNoPage orientation ('portrait' or 'landscape').portrait
contentFormatNoInput syntax format ('markdown' or 'html').markdown
watermarkTextNoOptional diagonal watermark text rendered across every page (e.g. 'CONFIDENTIAL' or 'DRAFT').
includePageNumbersNoInclude 'Page X of Y' running footers on every page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the pricing model ($0.004 USD per rendered PDF via x402 micropayment), the free dry-run validation path, the deterministic layoutDiagnostics output, and the exact pagination/header/footer behaviors. With readOnlyHint and idempotentHint already declaring the safety profile, this adds substantive cost and output-shape context an agent needs before spending money.

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?

Front-loaded with the verb and outputs, and the pricing sentence is separated cleanly at the end. The first sentence is very long and clause-dense, but each clause conveys a distinct rendering capability rather than filler.

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 an 11-parameter tool with no output schema, the description compensates by describing the return artifacts (themed HTML and spec-compliant multi-page PDF) and the diagnostics field. Nothing critical to correct invocation appears missing given the fully documented schema and safety annotations.

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% with descriptions on every property including enums, so the schema already carries the parameter semantics and the baseline is 3. The description adds marginal value by naming supported content constructs (GFM tables, callouts, '---pagebreak---'), which clarifies what the content string may contain, but it adds nothing about theme, pageSize, or watermark behavior beyond the schema.

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 ('Compiles') and resource (Markdown or HTML) with the exact outputs produced (themed HTML plus a PDF 1.7 binary). It also enumerates concrete rendering capabilities (running headers, 'Page X of Y' footers, repeated table headers, watermark), making it clearly distinguishable from the sibling inspect_pdf_document.

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?

Offers a useful practical tip — pass ?dry_run=true on REST to validate schema for free — and the contentFormat param implies choosing markdown vs html input. However, it never says when to use this tool rather than inspect_pdf_document, nor states prerequisites or exclusions, so routing guidance is only implied.

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