Skip to main content
Glama
MCP PDF Server

MCP PDF Server

by SantosRojas

generate_pdf

Create professional PDFs from a declarative JSON AST and save them to disk, with theme, metadata, and output path control—no HTML, CSS, or executable code.

Instructions

Genera un PDF profesional a partir de un AST JSON declarativo y lo guarda en disco. Sin outputDir usa la carpeta de salida del workspace; outputDir acepta rutas relativas al workspace (p. ej. "reports/2026") o absolutas dentro de las carpetas permitidas. Devuelve path absoluto, relativePath, páginas, tamaño y warnings. No acepta HTML, CSS, JavaScript ni código ejecutable.

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

Input Schema

NameRequiredDescriptionDefault
themeNo
contentYes
filenameYes
metadataNo
settingsNo
outputDirNo
overwriteNo
fixedFooterNo
fixedHeaderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses that the tool writes to disk, where the file lands by default, that paths are sandboxed to permitted folders, and what the response contains (absolute path, relativePath, pages, size, warnings). It does not explain what happens when the target file already exists, which matters given the undocumented overwrite parameter.

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?

Four tight sentences with the core action front-loaded, then output location, then return shape, then the negative constraint. Nothing is redundant, though the parenthetical example path is the only place a node-type hint could have gone instead.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter tool with a deeply nested discriminated-union AST, no annotations and no output schema, the description adequately covers the output side (destination and return fields) but leaves the input side almost entirely to the schema. An agent knows what it gets back but not how to shape content nodes or what overwrite does.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 9 parameters, so the description must compensate, and it only meaningfully explains outputDir (relative vs absolute, example path). The dominant parameter, content, is an enormous oneOf AST of ~20 node types that receives no explanation at all, and overwrite, theme, settings, metadata, fixedHeader/fixedFooter and filename constraints are untouched.

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?

States a specific verb and resource: generates a professional PDF from a declarative JSON AST and writes it to disk. The 'AST JSON' framing and the explicit exclusion of HTML/CSS/JS cleanly separate it from renderer-style tools, but no sibling (e.g. validate_pdf_ast, merge_pdfs) is named to sharpen 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?

The default behavior when outputDir is omitted and the allowed path forms are stated, which implies when the parameter matters, and 'No acepta HTML, CSS, JavaScript ni código ejecutable' rules out a whole class of wrong inputs. However there is no guidance on when to use this versus validate_pdf_ast or merge_pdfs, nor on whether validation should precede generation.

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