create-pdf
Create a final, ready-to-read PDF from markdown. Supports table of contents, headers/footers with page numbers, and multiple style presets.
Instructions
Create a FINAL, fixed-layout PDF to read / print / send / sign. USE when the user says PDF / print / 'send to the client' / official / invoice / flyer / resume / cover letter / 'read-only' / 'final version'. NOT for content they'll keep editing (→ create-doc) or code/repo docs (→ create-markdown). Rendered from markdown with the same 8 presets as create-doc, via headless Chromium. PDF SUPERPOWER: set toc: true for a clickable Table of Contents (with heading anchors) at the top. Supports headers/footers with {current}/{total} page numbers and margins. ALWAYS format the body with markdown. Easiest: put the whole body in the content string. Supported markdown: '# H1' '## H2' '### H3' headings; 'bold'; 'italic'; 'code'; '- ' or '1. ' lists; '> ' blockquotes; '---' horizontal rule; fenced code blocks; '| a | b |' GitHub tables (with a '|---|---|' separator row); 'text' links. EXAMPLE content: "## Overview\nThis report covers Q2 results.\n\n### Highlights\n- Revenue up 18%\n- Two new markets\n\n| Metric | Value |\n|---|---|\n| MRR | $42k |\n| Churn | 1.2% |\n\n> Next review: July." Title MUST be specific. Response includes formattingQuality and formatSuggestion. Use dryRun: true for preview. (To READ a PDF, use read-doc.)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| toc | No | Add a clickable Table of Contents (with heading anchors) at the top of the PDF. | |
| tags | No | Tags for registry search and discovery. | |
| style | No | Advanced: fine-grained style overrides merged on top of stylePreset. | |
| title | Yes | Specific descriptive title (rejected: 'Document', 'Untitled', etc.). Rendered as the top H1. | |
| dryRun | No | Return a preview without writing the file (default: false). | |
| footer | No | Page footer: { text, alignment?, color? }. Use {current}/{total} placeholders for page numbers. | |
| header | No | Page header: { text, alignment?: 'left'|'center'|'right', color?: '#hex' }. Applies to every page. | |
| tables | No | Optional tables as 2D arrays. First row is the header. Rendered as styled tables after the body. | |
| content | No | PREFERRED. The entire document body as ONE markdown string. Supported markdown: '# H1' '## H2' '### H3' headings; '**bold**'; '*italic*'; '`code`'; '- ' or '1. ' lists; '> ' blockquotes; '---' horizontal rule; ```fenced code blocks```; '| a | b |' GitHub tables (with a '|---|---|' separator row); '[text](https://url)' links. The title is added as the document H1 automatically, so start the body at '## '. EXAMPLE content: "## Overview\nThis report covers **Q2** results.\n\n### Highlights\n- Revenue up *18%*\n- Two new markets\n\n| Metric | Value |\n|---|---|\n| MRR | $42k |\n| Churn | 1.2% |\n\n> Next review: July." Use this instead of `paragraphs` unless you need per-paragraph style objects. | |
| docType | No | Tone and depth of the documentation. | |
| margins | No | Page margins in twips (1440 = 1 inch). Defaults: top/bottom 720 (or 1440 if header/footer set), left/right 1080. | |
| category | No | Document category for subfolder organization. | |
| uploadUrl | No | OPTIONAL. HTTPS URL of a receiver that will accept a JSON envelope `{data:base64, filename, mimeType, size}` POSTed with this Bearer auth. If you have NOT been given an uploadUrl in your context, OMIT this field and the tool just writes the file locally. Single-use semantics — do not retry on 4xx. Works with any compliant receiver (CogniRunner attachment-upload web trigger is the reference implementation, but the contract is generic). | |
| clientHint | No | How the response should be shaped. 'interactive' = polished one-line message for end-users (no chatty registry/lineage notes). 'agent' = verbose response with all metadata for AI consumption. 'auto' (default) = detect from input shape or MCP_CLIENT_TYPE env var, falling back to 'agent'. | |
| outputPath | No | Optional. Default: derived from title, placed under docs/<category>/. | |
| paragraphs | No | ALTERNATIVE to `content`. Body as an array of markdown strings or { text, headingLevel } objects. Prefer the single `content` string. | |
| description | No | Brief description stored in the registry. | |
| stylePreset | No | Style preset. 'claude-like' (modern blue-accented professional) is the default for general-purpose docs. 'professional' is the executive serif look. Auto-selected from category if omitted. | |
| uploadFilename | No | OPTIONAL. Filename to put in the upload envelope. Defaults to the local file's basename. Useful when the local file got auto-suffixed (e.g. duplicate prevention) and you want a clean name on the receiver side. | |
| uploadAuthHeader | No | OPTIONAL. Authorization header value for uploadUrl (e.g. 'Bearer abc123'). REQUIRED when uploadUrl is set; ignored otherwise. Never logged. | |
| enforceDocsFolder | No | If false, allow output outside docs/. Default: true (recommended). | |
| preventDuplicates | No | If false, allow same-title duplicates. Default: true (recommended). |