Skip to main content
Glama

generate-document-pdf

Generate a complete PDF from chapter image folders using four modes: original images, Tesseract OCR text, combined image+text, or LLaVA vision extraction for complex layouts.

Instructions

Generates a complete PDF from chapter image folders. Mode 'images' (default): inserts original images full-page, faithful to the original layout. Mode 'text': Tesseract OCR text only. Mode 'images+text': each original image followed by its Tesseract OCR text. Mode 'vision': LLaVA (Ollama local) extracts text -- best quality for complex layouts, requires Ollama running with llava model.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate-document-pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo'images' (default): original images full-page, faithful rendering. 'text': Tesseract OCR text only. 'images+text': image + Tesseract OCR text per page. 'vision': LLaVA vision text extraction via Ollama (local, requires ollama pull llava).
chaptersNoChapters to include (default: 1-9)
languageNoTesseract OCR language code (default: env OCR_LANGUAGE or 'fra'). Ignored in vision mode.
outputFilenameNoOutput PDF filename (default: 'document-complet.pdf')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose mode-specific behavior and the vision dependency. However, it omits important operational details such as whether an existing PDF is overwritten, required permissions, error handling, and where the output file is written.

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 description is front-loaded and contains no filler. The semicolon-separated mode list is dense but each mode detail is useful for invocation.

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?

The schema documents all parameters and the description explains mode behavior and dependencies, which is enough to select a mode. However, it leaves notable gaps about the expected chapter image folder location and output-file side effects, which matter because there are no annotations or 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 the schema already documents all four parameters. The description restates the mode meanings and vision requirement but adds no meaningful extra semantics for chapters, language, or outputFilename beyond what the schema provides.

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, resource, and input source: generates a complete PDF from chapter image folders. The mode list further clarifies the operation, making it distinguishable from siblings like generate-quiz or ask-document.

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?

Explains when each mode is appropriate, including that 'images' is default and 'vision' is best for complex layouts but requires Ollama running with the llava model. It does not explicitly state when not to use the tool or name sibling alternatives, but gives clear mode-selection context.

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