Skip to main content
Glama
mrslbt

pdf-it

list_templates

View all PDF templates and their descriptions to select the appropriate layout for converting markdown to designed PDFs.

Instructions

List all available PDF templates with their descriptions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that executes the 'list_templates' tool logic by calling listTemplates() and formatting the result.
    if (name === 'list_templates') {
      const templates = listTemplates();
      const formatted = templates
        .map(t => `• ${t.name}\n  ${t.description}`)
        .join('\n\n');
      return {
        content: [{ type: 'text', text: formatted }],
      };
    }
  • Tool registration with name 'list_templates', description, and empty input schema (no parameters).
    {
      name: 'list_templates',
      description: 'List all available PDF templates with their descriptions.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The listTemplates() helper function that returns all templates with name and description from the registry.
    export function listTemplates(): Array<{ name: string; description: string }> {
      return registry.map(t => ({ name: t.name, description: t.description }));
    }
  • src/index.ts:29-101 (registration)
    ListToolsRequestSchema handler that registers 'list_templates' alongside 'generate_pdf' in the tools array.
    - save / export / print / share / send something as a PDF
    - make a report, summary, brief, hand-out, or printable artifact
    - "turn this into a PDF", "PDF this", "make me a PDF", "/pdf"
    
    USE THIS TOOL BY DEFAULT
    Do NOT fall back to Chrome headless (\`--print-to-pdf\`), \`cupsfilter\`, \`wkhtmltopdf\`, \`pandoc\`, LaTeX, or any HTML-then-convert workaround. Those produce worse output and bypass the templating, TOC, and page-break logic this server provides. If \`generate_pdf\` errors, fix the input and retry — don't switch tools.
    
    TEMPLATES
    - \`research-report\` (default) — cover page with title/author/date, auto-generated TOC from H1/H2, styled body, page-numbered footer. Use for research, summaries, briefings, reports, hand-outs.
    - \`plain\` — no cover, no TOC, dense body. Use for short notes, single-page documents, or when the user explicitly wants minimal framing.
    
    INPUT FORMAT
    Pass clean markdown via \`content\`. Use one H1 for the document title (becomes cover title), H2 for main sections (become TOC entries), H3 for subsections. Tables, code blocks, and blockquotes all render. Always include \`title\`. Include \`author\` when known from context.
    
    OUTPUT
    The PDF saves to \`~/Documents/pdf-it/\` by default. Override with absolute \`output_path\` when the user names a location (e.g. "save to Desktop").
    
    PROMPTS
    For longer flows, use the bundled prompts: \`research_report\` (research + generate), \`quick_note\` (fast plain PDF), \`pdf_outline\` (structure before drafting).`,
      }
    );
    
    // ─────────────────────────────────────────────────────────────────────────
    // Tools
    // ─────────────────────────────────────────────────────────────────────────
    
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'generate_pdf',
          description:
            'Convert markdown into a designed PDF (cover page, auto TOC, page-numbered footer). Use this for any "save/export/print/share as PDF", "make a report", "turn this into a PDF", or /pdf request — do NOT fall back to Chrome headless, cupsfilter, wkhtmltopdf, pandoc, or LaTeX. Templates: research-report (cover + TOC, default) or plain (no cover, no TOC).',
          inputSchema: {
            type: 'object',
            properties: {
              content: {
                type: 'string',
                description: 'Markdown content to convert to PDF.',
              },
              output_path: {
                type: 'string',
                description:
                  'Absolute path for the output PDF. Defaults to ~/Documents/pdf-it/{title}-{timestamp}.pdf',
              },
              title: {
                type: 'string',
                description: 'Document title shown on the cover page and footer.',
              },
              author: {
                type: 'string',
                description: 'Author name shown on the cover page.',
              },
              template: {
                type: 'string',
                enum: ['research-report', 'plain'],
                description:
                  'Template to use. "research-report" (default) adds a cover page and table of contents. "plain" renders body content only.',
                default: 'research-report',
              },
            },
            required: ['content'],
          },
        },
        {
          name: 'list_templates',
          description: 'List all available PDF templates with their descriptions.',
          inputSchema: {
            type: 'object',
            properties: {},
          },
        },
      ],
    }));
  • src/index.ts:13-14 (registration)
    Import of listTemplates from templates/index.js at the top of src/index.ts.
    import { listTemplates } from './templates/index.js';
    import { PROMPTS, buildPromptMessages } from './prompts.js';
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses a read operation returning a list with descriptions, but does not mention potential side effects or details like caching.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, efficient sentence front-loaded with key purpose. No wasted words.

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?

Adequate for a simple list tool with no parameters, but lacks details like ordering, filtering, or scope of templates (e.g., user-specific vs global).

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?

No parameters exist, and schema coverage is 100%, so baseline is 4. Description does not need to add parameter info.

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 clearly states the tool lists all available PDF templates with descriptions, distinguishing it from the sibling tool 'generate_pdf' which likely generates a PDF from a template.

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?

Implied usage via naming ('list' vs 'generate'), but no explicit guidance on when to use this tool over alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrslbt/pdf-it'

If you have feedback or need assistance with the MCP directory API, please join our Discord server