mcp-pdf
v2026.9.22Secure FastMCP server for comprehensive PDF processing - text extraction, OCR, table extraction, forms, annotations, and more
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
textextraction__extract_text Textextraction Extract Text
Extract text from PDF and write to a .txt file. Returns the output file path and a short preview — full text is in the file, not in the response. Use output_directory to control where the file is saved, or set inline=True to get full text in the response instead. `method` defaults to "auto", which is what you want: it tries PyMuPDF, then pdfplumber, then pypdf, and returns the first engine that finds text. `method_used` names the winner, and `methods_attempted` appears when earlier engines were skipped. Name an engine to force it: "pymupdf" (fastest), "pdfplumber" (slower, reconstructs mul…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
chunk_pages | integer | Pages per chunk when inline=True (ignored for file output) |
inline | boolean | Return full text in response instead of writing to file |
max_tokens | integer | Max chars when inline=True (ignored for file output) |
method | string | "auto" (default) cascades PyMuPDF -> pdfplumber -> pypdf and keeps the first result containing text; an engine that raises, or that returns nothing, falls through to the next. Name an engine to force… |
output_directory | Directory to save the text file (default: temp directory) | |
pages | 1-based page selection, e.g. "5", "1,3,5", "1-10", "1,3-5,12-20". None (the default) extracts every page. | |
preserve_layout | boolean | Whether to preserve text layout and formatting |
textextraction__is_scanned_pdf Textextraction Is Scanned Pdf
Decide whether a PDF is page images with no text layer (scanned) or real selectable text. Read-only and cheap, writes nothing. Call it before extract_text or ocr_pdf so you pick the right one: is_scanned true means extract_text will come back empty and you want ocr_pdf; false means extract_text is exact and OCR would only add errors. Samples the FIRST 5 PAGES only, so a document that is text up front and scanned appendices later reads as not scanned. A page counts as textless when it yields 10 characters or fewer. The verdict is true when more than 60% of sampled pages are textless OR more th…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
textextraction__ocr_pdf Textextraction Ocr Pdf
Read text off the PIXELS of a scanned PDF: renders each page to an image and runs Tesseract on it. Writes the recognised text to '<stem>_ocr.txt' in output_directory (a fresh temp directory when you do not give one) and returns that path plus a ~500-character preview and per-page confidence. Set inline=True to get the full text and per-page results in the response and NO file. Only use this when the page has no text layer. Run is_scanned_pdf first: if the PDF already has real text, extract_text is faster by orders of magnitude and exact, while OCR invents plausible misreadings. This is the sl…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
dpi | integer | Render resolution before OCR. 300 is a good default; lower is faster and loses small type, higher is slower. |
inline | boolean | If True, return full OCR text plus per-page results in the response and write no file. Default False. |
languages | array | Tesseract language codes, joined with "+" internally. Each needs its language data installed on the host. |
output_directory | Where to write "<stem>_ocr.txt". Overwritten if it already exists. Defaults to a fresh temp directory. | |
pages | 1-based page selection, e.g. "5", "1,3,5", "1-10", "1,3-5,12-20". None (the default) processes every page. | |
preprocess | boolean | Convert the rendered page to greyscale first. |
tableextraction__extract_tables Tableextraction Extract Tables
Pull tabular data out of a PDF as rows, trying several extractors until one finds something. Read-only: results come back in the response and no file is written, so cap the volume with max_rows_per_table or summary_only on a big document. READ THIS ABOUT FAILURE. When no extractor finds a table you get success=false with error "No tables found or all extraction methods failed", and that single message covers both cases. In practice it almost always means THE PDF HAS NO DETECTABLE TABLES, not that anything broke — a document of flowing prose returns it every time. Do not report it to the use…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
max_rows_per_table | Truncate the returned rows per table. "total_rows" still reports the real count. | |
method | string | "auto" walks camelot -> pdfplumber -> tabula and keeps the first result. Name one explicitly only when you know the table style: camelot for ruled/bordered tables (needs Ghostscript), pdfplumber for b… |
pages | 1-based page selection, e.g. "5", "1,3,5", "1-10", "1,3-5,12-20". None (the default) means every page. | |
summary_only | boolean | Omit "data" (and rows_returned/rows_truncated) and return only each table's page, row count and column count. |
table_format | string | Shape of each table's "data" — "json" for row objects, "csv" for one CSV string, "html" for one HTML table. Ignored when summary_only is True. |
documentanalysis__analyze_pdf_health Documentanalysis Analyze Pdf Health
Triage a PDF before you spend time on it: can its pages be read, is it password protected, is it a dynamic XFA form, is it so text-poor that it probably needs OCR. Returns a 0-100 health_score with separate issues / warnings / recommendations lists. Read-only, writes nothing. Run this FIRST when a PDF misbehaves; the XFA warning in particular explains why extract_form_data or ocr_pdf would otherwise return an almost-empty Adobe placeholder page. Use extract_metadata instead for plain header fields, and analyze_pdf_security for encryption and permission detail — health is about usability, se…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
documentanalysis__extract_metadata Documentanalysis Extract Metadata
Read the document information dictionary (title, author, subject, keywords, creator, producer, creation/modification dates, trapped) plus page count, file size, permission flags and rough content estimates. Read-only: writes nothing. Pick between the three document-level analysers by what you want: extract_metadata — the factual header fields and page count. Start here when you need the title/author/date or just how many pages the file has. analyze_pdf_health — is this file usable? Returns a 0-100 score, issues, warnings, recommendations, plus XFA detection. analyze_pdf_securi…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
documentanalysis__get_document_structure Documentanalysis Get Document Structure
Cheap structural overview of a PDF: does it have a bookmark outline, how deep, are all pages the same size, which way are they rotated, does it contain form fields. Read-only, no file written, one pass over the pages. This is the shallow one. Choose between the three structure tools: get_document_structure — the PDF's OWN embedded outline plus page geometry. Nothing is inferred. Fast, and returns only a TRUNCATED TEXT PREVIEW of the bookmarks (first 20 indented titles); the per-bookmark page numbers are NOT in the response. detect_structure — infers chapters/sections even when t…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
formmanagement__create_form_pdf Formmanagement Create Form Pdf
Build a BRAND-NEW single-page PDF form from scratch, writing it to output_path. There is no input PDF; to add widgets to a document you already have, use add_form_fields instead. Requires reportlab (pip install mcp-pdf[forms]), and returns a clear error naming it if absent. `fields` is a JSON array of objects: [{"name": "applicant", "type": "text", "label": "Applicant name", "x": 50, "y": 700, "width": 220, "height": 20, "tooltip": "Legal name as on the deed"}, {"name": "county", "type": "dropdown", "options": ["Ada", "Canyon"]}, {"name": "agree", "type": "checkbox", "checked": fa…
| Parameter | Type | Description |
|---|---|---|
fields * | string | JSON array of field objects. Each may carry: - "name": AcroForm field name (default "field_<n>") - "type": "text" | "checkbox" | "dropdown" | "signature" (default "text"); other values… |
output_path * | string | Where to write the new PDF. Overwritten if it already exists. |
page_size | string | Sheet size, one of "A4", "Letter" or "Legal" (default "A4"). Case-sensitive. |
title | string | Value written into the PDF's document Title metadata (default "Form Document"). Not drawn on the page. |
formmanagement__extract_form_data Formmanagement Extract Form Data
List every interactive AcroForm field in a PDF with its name, type, current value, page, coordinates and required/readonly flags. Read-only: nothing is written. Run this FIRST to learn the exact field names before calling fill_form_pdf, whose data keys must match them byte for byte. Each field carries both `field_type`, from the portable six-term vocabulary shared with extract_xfa_fields (text, checkbox, radio, dropdown, date, signature, plus button and unknown), and `field_type_raw`, the unmerged AcroForm type that still distinguishes listbox from combobox. `coordinates` is {x, y, width, hei…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
formmanagement__extract_xfa_fields Formmanagement Extract Xfa Fields
Extract the XFA template field schema (names, captions, UI types) from a dynamic XFA PDF. Recovers form structure that extract_form_data can't reach because the fields aren't in AcroForm. Uses the zipForm producer profile by default; pass profile='generic' for forms from other producers and supply extra_plumbing_patterns / extra_positional_patterns. Returns shared (canonical) + positional + other + plumbing-dropped field breakdown. NOTE four categories, not three: 'other' is the default bucket for names matching neither the shared prefix nor a positional pattern, and on a non-zipForm producer…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to PDF file or HTTPS URL. |
canonical_separator | string | Separator for canonical names. "_" (snake, default), "." (dotted), or "-" (kebab). |
extra_plumbing_exact | Additional exact field names to drop as plumbing. Compared case-insensitively. | |
extra_plumbing_patterns | Regex patterns (strings) for additional plumbing fields. Matched case-insensitively as a SUBSTRING search, so they need no anchoring. | |
extra_positional_patterns | Regex patterns (strings) identifying additional opaque positional codes. Matched case-insensitively and ANCHORED AT THE START, so `tf\d+$` will not match `p01tf001` but `^p\d+tf\d+$` will. | |
include_design_time_bbox | boolean | Include best-effort design-time geometry on every field. NOT authoritative for dynamic XFA, whose subforms reflow at render time. Geometry is page-relative with a top-left origin, the opposite convent… |
max_inline_fields | Cap on fields serialized into the response (default 5000, or MCP_PDF_MAX_XFA_INLINE_FIELDS). Counts in `categories` and `shared_fields` always cover every field. | |
profile | string | Producer profile, matched case-insensitively. Either "zipform" (Lone Wolf / zipForm Plus conventions) or "generic" (only the Global_Info- shared-prefix convention; callers add producer-specific patter… |
formmanagement__fill_form_pdf Formmanagement Fill Form Pdf
Fill the interactive AcroForm fields of an existing PDF, writing a NEW PDF to output_path. Requires the PDF to have real form widgets: for a scanned or flat form with no widgets use fill_permit_form, which draws text at coordinates instead, and for a dynamic XFA form neither tool can fill it (see extract_xfa_fields). `form_data` is a JSON OBJECT keyed by AcroForm field name: {"applicant_name": "Jane Roe", "parcel": "R1234567", "agree": "Yes"} Names must match the document exactly; get them from extract_form_data. A key with no matching widget is SILENTLY IGNORED and appears in no error lis…
| Parameter | Type | Description |
|---|---|---|
form_data * | string | JSON object mapping AcroForm field name to value, e.g. {"applicant_name": "Jane Roe", "agree": "Yes"}. Names must match the document exactly (see extract_form_data); unmatched keys are ignored without… |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the filled PDF. Overwritten if it already exists; the source is never modified in place. |
flatten | boolean | When True, rasterise each page to a 72 DPI image and rebuild the document from those images. Fields become non-editable because they no longer exist, and all text becomes unsearchable. Default False,… |
formmanagement__is_xfa_pdf Formmanagement Is Xfa Pdf
Detect whether a PDF is XFA (Adobe LiveCycle / dynamic forms) and whether it is dynamic or static. Dynamic XFA forms cannot be rendered by any open-source PDF library; only Adobe's runtime executes them. Use this to branch BEFORE calling extract_form_data or convert_to_images on a PDF that might be dynamic XFA. Returns {success, is_xfa, xfa_type: 'dynamic'|'static'|None, has_acroform, detection_failed}. IMPORTANT: check detection_failed first. When it is true, is_xfa is null (not false) because the file could not be read at all, which is a different fact from 'no XFA here'.
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to PDF file or HTTPS URL. |
documentassembly__merge_pdfs Documentassembly Merge Pdfs
Concatenate two or more PDFs end-to-end into one NEW PDF at output_path, copying pages in the order given and carrying each source's bookmarks across with their page targets rebased onto the merged document. The response reports bookmarks_preserved and bookmarks_dropped (a bookmark whose target page is missing or non-positive cannot be rebased and is counted, not silently lost). Use merge_pdfs_advanced instead when you want each bookmark title prefixed with its source filename, a generated contents page, or per-file page ranges. `pdf_paths` is a JSON array of path strings, in the order you w…
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Where to write the merged PDF. Overwritten if it already exists; the sources are never modified. |
pdf_paths * | string | JSON array of PDF paths (local paths or HTTPS URLs) in concatenation order. Minimum of 2 entries. Example: ["/tmp/a.pdf", "/tmp/b.pdf"] |
documentassembly__reorder_pdf_pages Documentassembly Reorder Pdf Pages
Rebuild a PDF's pages in an order you specify, writing ONE new PDF to output_path. The output contains exactly the pages you list, in the order you list them, so this single tool also covers three jobs that sound like other tools: - EXTRACT a subset: list only the pages you want to keep - DUPLICATE a page: list it more than once - DELETE pages: leave them out of the list Unlike the split_* tools it never produces multiple files; use split_pdf_by_pages when you want several separate PDFs. `page_order` is a JSON array of 1-BASED page numbers: [3, 1, 2] -> a 3-page doc with page 3…
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Where to write the reordered PDF. Overwritten if it exists; the source is never modified in place. |
page_order * | string | JSON array of 1-based page numbers giving the output order. Repeats duplicate a page; omissions drop it. Any out-of-range or non-numeric entry aborts the call. Example: [3, 1, 2] |
pdf_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
documentassembly__split_pdf Documentassembly Split Pdf
Split a PDF into several new PDFs with ZERO configuration. It takes no output location and no range list: the pieces are written NEXT TO THE INPUT FILE, in the input's own directory, using names derived from the input's filename. Reach for this only when the built-in behaviour is exactly what you want; every other splitting need has a better-targeted tool. split_method picks one of three fixed behaviours: 'pages' (default) — one file per page: {stem}_page_1.pdf, {stem}_page_2.pdf, ... 'bookmarks' — one file per TOP-LEVEL (level 1) bookmark: {stem}_{…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF to split, or an HTTPS URL. Must have more than 1 page. Output files are written to this file's parent directory. |
split_method | string | Which fixed strategy to use. - "pages": one file per page, {stem}_page_N.pdf - "bookmarks": one file per level-1 bookmark, {stem}_{title}.pdf; errors if the PDF has no TOC - "ranges": consecutive 10… |
annotations__add_highlights Annotations Add Highlights
Highlight text in a PDF, writing a NEW PDF to output_path. Two mutually exclusive modes per highlight: by text (preferred) — searches the page and highlights EVERY match: [{"page": 1, "text": "net revenue", "color": "yellow"}] by rectangle — one explicit box; requires ALL FOUR of x1/y1/x2/y2: [{"page": 1, "x1": 72, "y1": 700, "x2": 300, "y2": 715, "color": "green"}] An object with neither `text` nor all four coordinates is skipped and reported in the errors list. Text search is literal, not regex, and will not match across a line break. If the text is absent the call still SU…
| Parameter | Type | Description |
|---|---|---|
highlights * | string | JSON array of highlight objects. Each needs EITHER "text" OR all four of "x1"/"y1"/"x2"/"y2": - "page": 1-based page number (default 1) - "text": literal string to find; every match on that page… |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the highlighted PDF. Overwritten if it exists; the source is never modified in place. |
annotations__add_stamps Annotations Add Stamps
Overlay status stamps (APPROVED, DRAFT, CONFIDENTIAL...) on a PDF, writing a NEW PDF to output_path. For free-text comments use add_sticky_notes; to mark up existing text use add_highlights. `stamps` is a JSON array: [{"page": 1, "type": "APPROVED", "x": 400, "y": 50, "size": "medium"}] type must be one of APPROVED, REJECTED, DRAFT, CONFIDENTIAL, REVIEWED, FINAL, COPY (UPPERCASE; default APPROVED). Each carries its own colour. size is small | medium | large, which is 80x30, 120x40 or 160x50 points (default medium). page is 1-based (default 1). x/y position the stamp's lower-left corner in…
| Parameter | Type | Description |
|---|---|---|
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the stamped PDF. Overwritten if it exists; the source is never modified in place. |
stamps * | string | JSON array of stamp objects. Each may carry: - "page": 1-based page number (default 1) - "type": APPROVED | REJECTED | DRAFT | CONFIDENTIAL | REVIEWED | FINAL | COPY, uppercase (default APPR… |
annotations__add_sticky_notes Annotations Add Sticky Notes
Add collapsed sticky-note (text) annotations at given coordinates, writing a NEW PDF to output_path. Reviewers see a note icon they click to read the comment. Use add_highlights instead to mark up existing text, and add_stamps for APPROVED/DRAFT-style overlays. `notes` is a JSON array of objects: [{"page": 1, "x": 100, "y": 200, "content": "Check this figure", "author": "R. Malloy"}] page is 1-based (default 1). x/y are PDF points from the page's BOTTOM-left origin, default 100/100. content defaults to "Note", author to "User". Every field except the object itself is optional, so a bare [{…
| Parameter | Type | Description |
|---|---|---|
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
notes * | string | JSON array of note objects. Each may carry: - "page": 1-based page number (default 1) - "x", "y": position in PDF points from the bottom-left origin (defaults 100, 100) - "content": t… |
output_path * | string | Where to write the annotated PDF. Overwritten if it already exists; the source is never modified in place. |
annotations__extract_all_annotations Annotations Extract All Annotations
Read every annotation already present in a PDF (sticky notes, highlights, stamps, ink, shapes) with its page, type, position, author and text. Read-only: nothing is written and the file is not modified. Use this to review a marked-up document, or to collect reviewer comments into one place. Returns counts per annotation type alongside the full list.
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
export_format | string | Shape of the returned annotation list. "json" gives structured objects (the default, best for programmatic use), "csv" a flat table, "text" a human-readable rendering. |
imageprocessing__extract_images Imageprocessing Extract Images
Extract the EMBEDDED raster images from a PDF and write each one as a separate file. Returns a summary plus one entry per image (filename, absolute path, page, pixel dimensions, byte size). Use pdf_to_markdown instead when you want the page text with the images referenced inline, and extract_vector_graphics for charts/schematics drawn as vector paths rather than stored as bitmaps. Files land in output_directory (created if missing); when it is omitted a fresh temp directory is made and its path is returned in extraction_summary.output_directory. Filenames are '{pdf_stem}_page_{N}_img_{M}.{out…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
context_chars | integer | Width in characters of that page-text slice (default 200). |
include_context | boolean | Attach a "context" string to each image entry. See the caveat in the tool description: it is a slice from the middle of the page text, not text near the image. |
min_height | integer | Skip images shorter than this many pixels (default 100). An image is skipped if EITHER dimension is under its limit. |
min_width | integer | Skip images narrower than this many pixels (default 100). |
output_directory | Directory to write the images into, created if it does not exist. Defaults to a new temp directory whose path is returned as extraction_summary.output_directory. | |
output_format | string | "png" (default), "jpg" or "jpeg". "jpg"/"jpeg" encode as JPEG, anything else as PNG; the value is also used verbatim as the file extension. |
pages | Pages to scan, 1-based. Accepts single pages, comma lists and ranges: "5", "1,3,5", "1-10", "1,3-5,7". None (default) means every page. A string that fails to parse is treated as None. |
imageprocessing__extract_vector_graphics Imageprocessing Extract Vector Graphics
Export PDF pages as SVG, capturing content drawn as vector paths: circuit schematics, IC block diagrams, response curves, dimensioned package outlines, PCB layouts. Use extract_images instead for content stored as bitmaps, and pdf_to_markdown when you want text plus auto-detected diagrams in one pass. UNCONDITIONAL, unlike pdf_to_markdown's vector step: every requested page is exported with no complexity threshold, so a text-only page still produces an SVG. Check the per-page drawing_count in the result to tell a real diagram from a page whose only 'vectors' are table rules. Modes: full_pa…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
include_text | boolean | Only affects full_page mode. True (default) keeps text as selectable SVG <text> elements; False converts glyphs to outlined paths — the text still LOOKS present but is no longer selectable or search… |
mode | string | "full_page" (default) renders the complete page; "drawings_only" rebuilds only the path geometry and always omits text; "both" writes one file of each. Any other value returns an error. |
output_directory | Directory to write the SVG files into, created if missing. Defaults to a new temp directory whose path comes back as extraction_summary.output_directory. | |
pages | Pages to export, 1-based. Accepts single pages, comma lists and ranges: "5", "1,3,5", "1-10", "1,3-5,7". None (default) means every page. An unparseable string is treated as None. | |
simplify_paths | boolean | Only affects full_page mode. Rounds coordinates with three or more decimals down to one decimal place to shrink the file. It does not remove or merge paths, and does not touch the drawings_only output… |
imageprocessing__markdown_to_pdf Imageprocessing Markdown To Pdf
Convert a Markdown file (or inline text) to PDF using pandoc. Auto-detects available PDF engines (xelatex, pdflatex, tectonic, weasyprint, wkhtmltopdf) and falls back through them in that order. Pass pdf_engine to override, or extra_args for custom pandoc options (e.g. ['-V', 'geometry:margin=1in']). Requires pandoc binary on host and at least one PDF engine. Install with: pip install mcp-pdf[markdown]
| Parameter | Type | Description |
|---|---|---|
output_path * | string | Where to write the resulting PDF (required). |
author | Document author (overrides any YAML frontmatter author). | |
base_path | Resource resolution base for relative image references. Defaults to the markdown file's directory when markdown_path is used. | |
date | Document date string (overrides any YAML frontmatter date). | |
extra_args | Additional raw pandoc CLI arguments (advanced). | |
markdown_path | Path to a .md file. Mutually exclusive with markdown_text. | |
markdown_text | Inline markdown content. Mutually exclusive with markdown_path. | |
pdf_engine | Force a specific engine ("xelatex", "pdflatex", "tectonic", "weasyprint", "wkhtmltopdf"). None (default) auto-detects the first of those five found on PATH, in that preference order. | |
title | Document title (overrides any YAML frontmatter title). | |
toc | boolean | Generate a table of contents from headings. |
imageprocessing__pdf_to_markdown Imageprocessing Pdf To Markdown
Convert PDF to markdown and write to a .md file. Raster images are extracted to {output_directory}/images/ and vector graphics (charts, schematics, diagrams) to {output_directory}/vectors/ as SVG. Returns the output file path and a short preview — full markdown is in the file. Set inline=True to get full markdown in the response instead. Use output_filename to override the default .md filename. Set vector_fallback_raster=True to render pages with sub-threshold drawings as raster images instead of skipping them entirely.
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
image_format | string | "png" (default), "jpg" or "jpeg". "jpg"/"jpeg" encode as JPEG, anything else as PNG; the value is also the file extension. |
include_images | boolean | Whether to include raster images in markdown |
include_metadata | boolean | Prepend a "# Document Metadata" block built from the PDF's own metadata dict. Skipped when every value is empty. |
include_vectors | boolean | Extract significant vector graphics as SVG (default: True). Detects charts, schematics, and technical drawings automatically. |
inline | boolean | Return the full markdown in the response instead of writing the .md file. NOTE: images and vectors are still extracted to disk under output_directory, so this is not a dry run. |
min_height | integer | Minimum image height in pixels (default 100). |
min_width | integer | Minimum image width in pixels (default 100). An image is skipped when EITHER dimension is below its limit. |
output_directory | Directory for output .md file and images/ subdirectory. Defaults to a temp directory if not specified. | |
output_filename | Custom filename for the output .md file (e.g., "chapter_1.md"). A missing ".md" suffix is appended. Defaults to the PDF filename with .md extension. | |
pages | Pages to convert, 1-based. Accepts single pages, comma lists and ranges: "5", "1,3,5", "1-10", "1,3-5,7". None (default) means every page. An unparseable string is treated as None. A "## Page N" heade… | |
vector_fallback_raster | boolean | When True, pages with drawings below the vector complexity threshold are rendered as full-page raster images (PNG at 150 DPI) instead of being skipped. Captures charts and diagrams that are too simple… |
vector_min_complexity | integer | Minimum total path items for extraction (default: 50) |
vector_min_drawings | integer | Minimum drawing count per page to consider (default: 5) |
advancedforms__add_date_field Advancedforms Add Date Field
Add ONE text widget intended to hold a date, writing a NEW PDF to output_path. NO validation is applied, despite the name. date_format is free text interpolated verbatim into an optional grey "Format: ..." caption drawn to the RIGHT of the box; the widget itself is an ordinary AcroForm text field with no format action, so a reader accepts anything typed into it and fill_form_pdf accepts any string. If you need the value checked, run validate_form_data with a `pattern` rule separately. Positioning is in PDF points from the page's BOTTOM-left origin: the box spans (x, y) to (x+width, y+height)…
| Parameter | Type | Description |
|---|---|---|
field_name * | string | AcroForm field name for the widget. Used verbatim. |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the modified PDF. Overwritten if it already exists; the source is never modified in place. |
date_format | string | Free-text pattern shown in the caption, default "MM/DD/YYYY". Purely cosmetic; it is not parsed and not enforced, so any string is accepted here and in the field. |
height | integer | Box height in points (default 25). |
label | string | Caption drawn 15 points below y in 10pt black. Empty string (the default) draws nothing. |
page | integer | 1-based page number (default 1). Out of range is an error. |
show_format_hint | boolean | Draw the grey "Format: <date_format>" caption to the right of the box (default True). |
width | integer | Box width in points (default 150). |
x | integer | Left edge in PDF points from the page's bottom-left origin (default 50). |
y | integer | Bottom edge in PDF points from the page's bottom-left origin (default 100). |
advancedforms__add_form_fields Advancedforms Add Form Fields
Add interactive AcroForm widgets to an EXISTING PDF, writing a NEW PDF to output_path. Use create_form_pdf to build a form on a blank page instead, and add_radio_group / add_textarea_field / add_date_field for those single specialised widgets. IMPORTANT: only type "text" and type "checkbox" actually create a widget. Any other value (dropdown, radio, signature) still counts toward fields_added but produces NOTHING in the output, so verify with extract_form_data before trusting the count. `fields` is a JSON array of objects: [{"page": 1, "type": "text", "name": "applicant", "x": 72, "y": 700…
| Parameter | Type | Description |
|---|---|---|
fields * | string | JSON array of field objects. Each may carry: - "page": 1-based page number (default 1). Out-of-range pages are skipped without an error. - "type": "text" or "checkbox" (default "text")… |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the modified PDF. Overwritten if it already exists; the source is never modified in place. |
advancedforms__add_radio_group Advancedforms Add Radio Group
Draw a vertical column of radio-button widgets with a text label beside each, writing a NEW PDF to output_path. The buttons ARE mutually exclusive: every widget in the group shares the one field name you pass as group_name, which is what makes a PDF reader allow only one selection, and each carries a distinct on-state derived from its option label. So the field's value identifies the chosen option rather than a generic "Yes", and "Off" means nothing is selected yet. A PDF name cannot contain spaces or punctuation, so the export value is a sanitised form of the label: "Conventional Loan" beco…
| Parameter | Type | Description |
|---|---|---|
group_name * | string | The AcroForm field name shared by every button in the group. Sharing one name is what makes the buttons mutually exclusive, and the field's value is whichever option label is currently selected ("Off"… |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
options * | string | JSON array of label strings, e.g. ["Residential", "Commercial"]. One 15x15 point button is drawn per entry, in array order. |
output_path * | string | Where to write the modified PDF. Overwritten if it already exists; the source is never modified in place. |
page | integer | 1-based page number (default 1). Out of range is an error. |
spacing | integer | Points added to y per option (default 30). Positive values stack options upward; pass a negative value to run down the page. |
x | integer | Left edge of every button, in PDF points from the page's bottom-left origin (default 50). |
y | integer | Bottom edge of the FIRST button, in PDF points from the page's bottom-left origin (default 100). |
advancedforms__add_textarea_field Advancedforms Add Textarea Field
Add ONE large text widget to an existing PDF, writing a NEW PDF to output_path. Use add_form_fields to add several ordinary-sized fields in a single call. What it really produces is a plain AcroForm text widget of the given size. word_limit is NOT enforced anywhere: it only supplies the number in an optional grey "Max words: N" caption, and a reader will happily accept more. The widget is also not flagged multiline, so wrapping is up to the reader. Positioning, all in PDF points from the page's BOTTOM-left origin: the box spans (x, y) to (x+width, y+height). `label`, if non-empty, is drawn 1…
| Parameter | Type | Description |
|---|---|---|
field_name * | string | AcroForm field name for the widget. Used verbatim. |
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_path * | string | Where to write the modified PDF. Overwritten if it already exists; the source is never modified in place. |
height | integer | Box height in points (default 100). |
label | string | Caption text drawn 15 points below y in 10pt black. Empty string (the default) draws nothing. |
page | integer | 1-based page number (default 1). Out of range is an error. |
show_word_count | boolean | Draw the grey "Max words: N" caption above the box (default True). |
width | integer | Box width in points (default 400). |
word_limit | integer | Number shown in the "Max words: N" caption (default 500). Advisory only; nothing enforces it. |
x | integer | Left edge in PDF points from the page's bottom-left origin (default 50). |
y | integer | Bottom edge in PDF points from the page's bottom-left origin (default 100). |
advancedforms__validate_form_data Advancedforms Validate Form Data
Check a JSON payload of field values against a JSON payload of rules. Read-only: nothing is written. This is PURE DATA validation. pdf_path is opened only far enough to validate the path; the document's form fields are NEVER read, so nothing here confirms that a field name exists in the PDF or that its type matches. Call extract_form_data first to learn the real names. For the coordinate-overlay (permit) field-definition format, use validate_permit_form_data instead. `form_data` is a JSON object of field name -> value: {"applicant": "Jane Roe", "zip": "83702"} `validation_rules` is a JSON…
| Parameter | Type | Description |
|---|---|---|
form_data * | string | JSON object mapping field name to value, e.g. {"applicant": "Jane Roe", "zip": "83702"}. Only the keys present here are validated. |
pdf_path * | string | Path to a PDF, or an HTTPS URL to fetch. Only used to validate the path and echo it back; its form fields are not inspected and play no part in the result. |
validation_rules | string | JSON object keyed by field name. Each value may carry "required" (bool, fails on any falsy value), "max_length" (int, against len(str(value))) and "pattern" (regex applied with re.match, start-anchore… |
securityanalysis__analyze_pdf_security Securityanalysis Analyze Pdf Security
Report how locked-down a PDF is: encryption, the eight permission flags, whether metadata could leak information, and a 0-100 security_score. Read-only, writes nothing, and it does NOT change any protection — there is no tool here that adds or removes a password. READ THIS BEFORE REPORTING THE SCORE. The score measures restriction, not safety. A perfectly ordinary, benign, unencrypted PDF with a title and author loses 20 points for having no password and 10 more for each warning, so it typically lands around 40 and gets labelled "Low" or even "Critical". That is the expected reading for a n…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
securityanalysis__detect_watermarks Securityanalysis Detect Watermarks
Look for probable watermark markings on every page and report where they are. Read-only: it DETECTS, it cannot add or remove a watermark, and nothing is written. Scans ALL pages with no cap, so it is the slowest tool in this group on a long document. It is a keyword-and-size heuristic, not real watermark analysis — it never inspects opacity, rotation or draw order. Treat every hit as a candidate to verify, and expect false positives: text — a text span that equals DRAFT, CONFIDENTIAL, COPY, SAMPLE or WATERMARK, or merely CONTAINS "watermark", "confidential" or "draft" case-insensitivel…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
contentanalysis__analyze_layout Contentanalysis Analyze Layout
Describe the geometry WITHIN pages: how many text blocks, their sizes and bounding boxes, how many columns the text appears to be in, how much of the page the text covers, and a coarse layout_type per page. Read-only, writes nothing. Page-level, not document-level. Use get_document_structure for the bookmark outline and page sizes, and detect_structure to find chapters and sections. Reach for analyze_layout when you need to know whether text is in two columns before extracting it, or where on the page a block sits so you can place an annotation. DEFAULTS TO THE FIRST 5 PAGES ONLY when `pages…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
include_coordinates | boolean | Include each text block's x1/y1/x2/y2 box in the response. Purely a verbosity switch; estimated_columns and layout_type are computed the same way with it off. |
pages | 1-based page selection, e.g. "5", "1,3,5", "1-10", "1,3-5,12-20". None (the default) analyses the FIRST 5 PAGES, not all of them. An unparseable value falls back to the first 5. |
contentanalysis__classify_content Contentanalysis Classify Content
Guess what KIND of document this is — academic, business, legal, technical, financial, medical or educational — and report reading level, vocabulary diversity and rough word/image/link counts. Read-only, writes nothing, samples the first 10 pages. classify_content answers "what is this document?"; summarize_content answers "what does it say?" and returns actual sentences and keywords. Ask this one first when routing a pile of unknown PDFs, then summarize the ones that matter. ALWAYS CHECK confidence BEFORE USING primary_type. Classification is a raw count of fixed keyword substrings per…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
contentanalysis__summarize_content Contentanalysis Summarize Content
Pull representative sentences, frequent keywords, capitalised topics, dates and numbers out of a PDF. Read-only, writes nothing. Processes ALL pages by default, so pass `pages` on a long document. This is EXTRACTIVE and purely statistical — no model is called, so there is no abstractive prose and no paraphrase. If you want an actual written summary, take the returned sentences and write it yourself, or use extract_text and read the text. Use classify_content instead to learn what kind of document this is. Two things about `summary.sentences` that will surprise you: only the FIRST 50 SENTEN…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an http(s) URL to fetch. |
pages | 1-based page selection, e.g. "5", "1,3,5", "1-10", "1,3-5,12-20". None (the default) means every page. An unparseable value falls back to every page. | |
summary_length | string | How many sentences to return — "short" gives 3, "medium" 7, "long" 15. |
pdfutilities__compare_pdfs Pdfutilities Compare Pdfs
Report whether two PDFs differ, and roughly how much, across page count, file size, text, metadata and bookmarks. Read-only: nothing is written and neither file is modified. This is a SAMENESS CHECK, NOT A DIFF. It never tells you WHAT changed in the text and never produces a marked-up document. Two limits matter before you trust the number: - text is read from AT MOST THE FIRST 10 PAGES of each file (fewer if either is shorter), so a change on page 11 is invisible; - similarity_score compares the two texts position by position, so inserting or deleting a few words near the start shifts e…
| Parameter | Type | Description |
|---|---|---|
pdf_path1 * | string | Path to the first PDF, or an HTTPS URL to fetch. |
pdf_path2 * | string | Path to the second PDF, or an HTTPS URL to fetch. |
comparison_type | string | Which comparisons to run. - "text": first 10 pages only, positional similarity score - "metadata": document info dictionary differences - "structure": bookmark/TOC equality and counts - "all": all thr… |
pdfutilities__convert_to_images Pdfutilities Convert To Images
RENDER whole PDF pages to raster image files, one image per page, exactly as the page would look on screen (text, vectors and pictures flattened together). This is what you want to LOOK AT a page or feed it to a vision model. Do not confuse it with the extract_* tools, which pull out what is stored inside the file rather than a picture of the page: extract_images pulls the EMBEDDED bitmaps out on their own, and extract_vector_graphics exports pages as SVG for schematics and line art. Files are written into the INPUT PDF's own directory as {output_prefix}_{3-digit 1-based page}.{format} — f…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the source PDF, or an HTTPS URL. Images are written into this file's parent directory. |
dpi | integer | Render resolution, default 300. Lower it (100-150) for previews or vision-model input; higher values grow both dimensions and the file size quadratically. |
format | string | "png" (default, lossless) or "jpg"/"jpeg" (smaller, lossy). Also becomes the file extension. |
output_prefix | string | Filename stem for the outputs, default "page", giving page_001.png, page_002.png, ... |
pages | Comma/range string of 1-based page numbers, e.g. "1,4-6,9". Ranges are inclusive. None (the default) renders every page. |
pdfutilities__optimize_pdf Pdfutilities Optimize Pdf
Rewrite a PDF more compactly by garbage-collecting unused objects and deflating streams. Writes a NEW file named {original_stem}_optimized.pdf IN THE SAME DIRECTORY as the input; there is no output-path parameter, so you cannot choose the name or location, and an existing file with that name is overwritten. The original is left untouched. The three levels are structural cleanups and are lossless on their own: they never subset fonts, and they only touch image data when preserve_quality is False (see below). On a file that is already mostly image data a lossless run therefore saves close to no…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF to optimize, or an HTTPS URL. The output is written alongside it as {stem}_optimized.pdf. |
optimization_level | string | "light", "balanced" (default) or "aggressive". Each is a lossless structural cleanup on its own; pair with preserve_quality=False to also recompress images. See the tool description for what each one… |
preserve_quality | boolean | True (default) keeps the whole operation lossless. False additionally recompresses eligible images as JPEG, quality 50 for "aggressive" and 75 otherwise. Skips images with alpha, CMYK/exotic colourspa… |
pdfutilities__repair_pdf Pdfutilities Repair Pdf
Salvage a damaged PDF by opening it, testing every page, and rewriting the readable ones into a clean file named {original_stem}_repaired.pdf IN THE SAME DIRECTORY as the input. There is no output-path parameter, and an existing file with that name is overwritten. The original is left untouched. Pages that cannot be read are dropped, and their 1-based numbers are listed in corrupted_page_numbers, so the repaired file may have FEWER pages than the original. Two hard limits on what it can rescue: - the file must still start with a valid %PDF- header, or it is rejected before repair is even at…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the damaged PDF, or an HTTPS URL. The repaired copy is written alongside it as {stem}_repaired.pdf. The file must have a valid %PDF- header and must still be openable. |
pdfutilities__rotate_pages Pdfutilities Rotate Pages
Set the display rotation of some or all pages, writing a NEW PDF. Fixes sideways scans and landscape pages. rotation is ABSOLUTE, not additive: it sets each chosen page's rotation to that value, so rotating by 90 twice still leaves the page at 90, not 180. Only 90, 180 and 270 are accepted (clockwise). There is no 0 and no negative, so you cannot un-rotate a page with this tool — pick the absolute angle you want instead. `pages` is a plain comma/range STRING of 1-based page numbers, NOT JSON: "3", "1,3,5", "2-7", or mixed "1,4-6,9". Leave it out (or null) to rotate EVERY page. A range is i…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the source PDF, or an HTTPS URL. The output is written into this file's parent directory. |
output_filename | string | Filename only (no directory), created next to the input. Defaults to "rotated_document.pdf". |
pages | Comma/range string of 1-based page numbers, e.g. "1,4-6,9". Ranges are inclusive. None (the default) rotates all pages. | |
rotation | integer | Absolute clockwise rotation to apply: 90, 180 or 270. Anything else is rejected. Not cumulative across calls. |
misctools__add_field_validation Misctools Add Field Validation
Attach input constraints to the AcroForm fields of an existing PDF, writing a NEW PDF to output_path. It changes the FORM ITSELF so a person typing into it is constrained; it does not check any data. To check values you already have against rules, use validate_form_data (pure data, writes nothing). To put values INTO the form, use fill_form_pdf. `validation_rules` is a JSON OBJECT keyed by EXACT form field name (not an array), each mapping to a rules object: {"applicant_name": {"max_length": 40}, "parcel_id": {"max_length": 12, "required": true}} ONLY TWO KEYS ARE READ, and only on…
| Parameter | Type | Description |
|---|---|---|
input_path * | string | Path to the source PDF with form fields, or an HTTPS URL to fetch. |
output_path * | string | Where to write the modified PDF. Overwritten if it exists; the source is never modified in place. |
validation_rules * | string | JSON object mapping exact field name to a rules object. Recognised keys are "max_length" (applied) and "required" (counted only, not enforced); everything else is ignored. Example: {"parcel_id": {"max… |
misctools__extract_charts Misctools Extract Charts
Survey a PDF's visual elements, guess which are charts or diagrams, and optionally crop each one out to a PNG. Without output_directory it writes nothing and returns only the inventory: page, kind, dimensions and a likely_chart flag per element. Pass output_directory to also render every flagged element, cropped from its page at render_dpi, with the file path on each element as image_path. Cropping the PAGE rather than pulling the underlying object means a chart assembled from many vector strokes comes out as one picture, and a raster chart comes out composited with anything drawn over it. R…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
min_size | integer | Minimum width or height for an element to be listed, default 100. Pixels for embedded images, PDF points for vector drawings. |
output_directory | Where to write cropped PNGs of the elements flagged likely_chart, created if missing. Omit it (the default) to get the inventory only and write nothing. | |
pages | Comma/range string of 1-based page numbers, e.g. "1,4-6,9". Ranges are inclusive. None (the default) scans every page, as does an unparseable or out-of-range string. | |
render_dpi | integer | Resolution for those crops, default 150, clamped to 36-600. Only used when output_directory is supplied. |
misctools__extract_links Misctools Extract Links
List the hyperlinks in a PDF with their page, rectangle, target and type, plus a domain rollup and the email addresses found. Read-only: nothing is written and the file is not modified. It reads real PDF LINK ANNOTATIONS, the clickable regions. A URL that merely appears as text with no link attached to it is NOT returned — use extract_text and scan the text yourself for those. Three link kinds are reported: 'external' for http/https URLs (with `url`), 'email' for mailto: targets (with `email`), and 'internal' for jumps within the document (with `target_page`, 1-based). The three include_*…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
include_email | boolean | Keep mailto: links (type "email"). Default true. |
include_external | boolean | Keep http/https links (type "external"). Default true. |
include_internal | boolean | Keep same-document jump links (type "internal"). Default true. |
pages | Comma/range string of 1-based page numbers, e.g. "1,4-6,9". Ranges are inclusive. None (the default) scans every page, as does an unparseable or out-of-range string. |
misctools__merge_pdfs_advanced Misctools Merge Pdfs Advanced
Concatenate two or more PDFs into one NEW PDF at output_path, CARRYING THE SOURCE BOOKMARKS ACROSS. That is the whole reason to choose this over merge_pdfs, which is otherwise identical but throws every bookmark away. If none of the sources have bookmarks and you do not want a contents page, merge_pdfs is the simpler call. `input_paths` is a JSON array of path strings, in the order you want them concatenated: ["/docs/part1.pdf", "/docs/part2.pdf"] AT LEAST TWO paths are required. Each may be a local path or an HTTPS URL. A source that fails to open aborts the whole call and writes nothing.…
| Parameter | Type | Description |
|---|---|---|
input_paths * | string | JSON array of PDF paths (local paths or HTTPS URLs) in concatenation order. Minimum of 2 entries. Example: ["/tmp/part1.pdf", "/tmp/part2.pdf"] |
output_path * | string | Where to write the merged PDF. Overwritten if it exists; the sources are never modified. |
add_page_numbers | boolean | Stamp "N / total" at the bottom centre of each page, 9pt grey, after any contents page is inserted so the numbering covers it and matches the final page count. Default false. |
include_toc | boolean | Prepend a plain-text cover page listing each source file and its page count. No links. Default false. |
preserve_bookmarks | boolean | Carry each source's outline across with page numbers rewritten and titles prefixed by source filename. Default true. |
misctools__split_pdf_by_bookmarks Misctools Split Pdf By Bookmarks
Split a PDF at its own BOOKMARK (outline) entries, one new PDF per bookmark, into an output_directory you choose (created if missing). Each piece runs from its bookmark's page up to the page before the next bookmark AT THE SAME LEVEL, and the last piece runs to the end of the document. It REQUIRES a real embedded outline and fails with an error if the PDF has none, or none at the level you asked for. When there are no bookmarks but the pages do show headings, use split_pdf_by_structure, which detects them (and can emit markdown and images per section). Use split_pdf_by_pages when you want to…
| Parameter | Type | Description |
|---|---|---|
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. Must contain an embedded outline. |
output_directory * | string | Directory for the split files. Created along with any missing parents. |
bookmark_level | integer | Exact outline depth to split on. 1 (default) is top level, 2 is the next level down. Levels are not nested together. |
naming_pattern | string | Output filename template. Only {title} (the sanitised bookmark text, max 50 chars) and {index} (1-based) are substituted. Default "{title}.pdf". |
misctools__split_pdf_by_pages Misctools Split Pdf By Pages
Split a PDF into several new PDFs at PAGE RANGES YOU CHOOSE, written into an output_directory you choose (created if it does not exist) with filenames you control. This is the splitting tool to reach for by default. Prefer split_pdf_by_bookmarks when the document's own outline already marks the boundaries, split_pdf_by_structure when it has visible headings but no bookmarks, and reorder_pdf_pages when you want the selected pages in ONE file rather than several. `page_ranges` MUST BE A JSON ARRAY OF STRINGS. Quote every element, and keep the outer brackets even for a single range: '["1-5", "…
| Parameter | Type | Description |
|---|---|---|
input_path * | string | Path to the source PDF, or an HTTPS URL to fetch. |
output_directory * | string | Directory for the split files. Created along with any missing parents. |
page_ranges * | string | JSON array of range STRINGS, 1-based and inclusive. Each element is "first-last", a bare page number, or "first-end" to run to the last page. Ranges beyond the document are clamped, not rejected. Exam… |
naming_pattern | string | Output filename template. Only {start}, {end} and {index} are substituted. Default "page_{start}-{end}.pdf". |
structuredetection__batch_extract Structuredetection Batch Extract
Extract multiple page ranges from a single PDF, each producing its own markdown + images + vectors in a separate output directory. Replaces 24+ individual tool calls with a single operation.
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. Opened once and reused for every section. |
sections * | string | JSON string — a non-empty array of objects, each with: - "pages": REQUIRED page range, 1-based. Only these three forms parse: "11-80", "5" (single page) or "11-end". A comma list such as "1,4,9"… |
include_images | boolean | Extract raster images during markdown conversion. |
include_vectors | boolean | Extract vector graphics during markdown conversion. |
structuredetection__detect_structure Structuredetection Detect Structure
Detect logical structure (chapters, sections, headings) of a PDF using bookmarks, font-size analysis, and numbering patterns. By default writes full structure to a JSON file and returns a compact summary with the file path. Set inline=True to return the complete structure in the response (use for small documents). strategies="auto" (the default) is adaptive: it reads the PDF's own bookmarks and only falls back to the font and numbering heuristics when there is no usable outline. Pass "all" to force every detector and merge where they agree, which is slower but catches headings a table of cont…
| Parameter | Type | Description |
|---|---|---|
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
heading_pattern | Extra user regex applied to page text on top of whichever strategies ran (IGNORECASE | MULTILINE). Every match becomes a level-1 boundary at confidence 0.85. An invalid regex is logged and skipped, no… | |
inline | boolean | If True, return full structure in the response and write NOTHING to disk. Useful for small documents or internal calls. Default: False. |
max_heading_levels | integer | Maximum heading depth to report, clamped to 1-6 (default 3). Also caps how many font-size clusters become levels. |
min_confidence | number | Drop boundaries below this confidence, 0-1 (default 0.5). Rough scale: bookmarks 0.95, user regex 0.85, fonts 0.70-0.90, numbering 0.70-0.80; a boundary confirmed by two detectors gains 0.05, capped a… |
output_directory | Directory for the structure JSON file, created if missing. Defaults to the directory holding the PDF, so a read-looking call still writes next to the source. The file is named "{pdf_stem}_structure.js… | |
pages | Pages to analyse, 1-based. Accepts single pages, comma lists and ranges: "5", "1,3,5", "1-10", "1,3-5,7". None (default) means every page. Bookmark detection always covers the whole document; this onl… | |
strategies | string | Which detectors to run, then merge — "auto" adaptive (the default): run bookmarks first, and only fall through to fonts + numbering when the PDF has no usable outline (f… |
structuredetection__split_pdf_by_structure Structuredetection Split Pdf By Structure
Detect document structure then split the PDF into per-chapter/section directories. Each section gets its own PDF and optionally markdown + images. Combines detect_structure + split + pdf_to_markdown into one operation.
| Parameter | Type | Description |
|---|---|---|
output_directory * | string | Root directory for section output folders, created if missing. One subdirectory per section, named "{index:02d}_{sanitised_title}" (title stripped of punctuation and truncated to ~50 chars). |
pdf_path * | string | Path to the PDF, or an HTTPS URL to fetch. |
heading_pattern | Optional user-supplied regex for headings, applied as in detect_structure (matches become level-1 boundaries). | |
include_images | boolean | Extract raster images during markdown conversion. |
include_markdown | boolean | Convert each split PDF to markdown. Only takes effect when output_format is "markdown" or "both". |
include_vectors | boolean | Extract vector graphics during markdown conversion. |
min_confidence | number | Drop boundaries below this confidence, 0-1 (default 0.5). If nothing survives the split_level + min_confidence filter the call returns success=false with the total boundary count, which is the cue to… |
output_format | string | "markdown" (default) writes the markdown and then DELETES the intermediate per-section PDF — though only when the markdown actually succeeded, so a failed conversion silently leaves the PDF behind;… |
split_level | integer | Split on every boundary whose level is <= this value, so 1 = chapters only, 2 = chapters and their sections, and so on (default 1). Sections run from their own start page to the page before the next b… |
strategies | string | Detection strategy, same values as detect_structure. Structure is always detected over the WHOLE document; there is no pages parameter here. |
permitform__fill_permit_form Permitform Fill Permit Form
Fill ANY PDF (scanned, flat, no AcroForm widgets at all) by drawing text and X marks at caller-supplied coordinates and merging that overlay onto the template. Use fill_form_pdf instead when the PDF has real interactive fields; use preview_field_positions to check your coordinates before committing. Requires reportlab (pip install mcp-pdf[forms]). Supply coordinates through EXACTLY ONE of field_definitions (inline JSON) or field_definitions_path (a local .json file). Both, or neither, is an error. The shape is an object whose `pages` maps a STRING page number to an array of field objects: {…
| Parameter | Type | Description |
|---|---|---|
form_data * | string | JSON object mapping field name to value, e.g. {"owner": "Jane Roe", "is_repair": true}. Names must match the "name" keys in the field definitions; unknown keys are ignored. Must be a JSON object, not… |
template_path * | string | Path to the template PDF, or an HTTPS URL to fetch. Never modified in place. |
field_definitions | The field-definition document as an inline JSON string. Mutually exclusive with field_definitions_path, and exactly one of the two is required. Needs a top-level "pages" object keyed by page number as… | |
field_definitions_path | Local filesystem path to a .json file holding the same document. Not a URL, and it must exist. | |
output_path | Where to write the filled PDF. Overwritten if it exists. When omitted, the PDF comes back as pdf_base64 in the response instead of being written anywhere. |
permitform__get_field_schema Permitform Get Field Schema
Summarise a permit-form field-definition document: every field's name, type, page and constraints, sorted by page then name, with a per-type histogram. Read-only, and it never opens a PDF: it reads ONLY the definition JSON, so it tells you what the definitions claim, not what the template looks like. To inspect a PDF's own interactive fields use extract_form_data; to see the boxes drawn on the template use preview_field_positions. Supply the document through EXACTLY ONE of field_definitions (inline JSON) or field_definitions_path (a local .json file); both, or neither, is an error. Same shape…
| Parameter | Type | Description |
|---|---|---|
field_definitions | The field-definition document as an inline JSON string. Mutually exclusive with field_definitions_path; exactly one of the two is required. Needs a top-level "pages" object keyed by page number as a S… | |
field_definitions_path | Local filesystem path to a .json file holding the same document. Not a URL, and it must exist. |
permitform__insert_attachment_pages Permitform Insert Attachment Pages
Build extra US-Letter pages holding an image or a block of text and splice them into an existing PDF, writing a NEW PDF. Each attachment can also stamp a small "<title> - See page N" box onto an existing page so the form points at its exhibit. Use merge_pdfs to join whole documents instead. Requires reportlab (pip install mcp-pdf[forms]). `attachments` is a JSON ARRAY of objects (this example is valid JSON, with no comments): [{"name": "site_photo", "page_title": "Site Photo", "insert_after_page": 2, "content_type": "image", "image_path": "/tmp/site.jpg", "image_fit": "contain",…
| Parameter | Type | Description |
|---|---|---|
attachments * | string | JSON array of attachment objects. Each may carry: - "name": label used in the results (default "attachment_<index>") - "page_title": header text (default: name) - "insert_after_page": 1-base… |
source_pdf_path * | string | Path to the PDF to extend, or an HTTPS URL to fetch. Never modified in place. |
output_path | Where to write the resulting PDF. Overwritten if it exists. When omitted, the PDF comes back as pdf_base64 in the response instead of being written anywhere. |
permitform__preview_field_positions Permitform Preview Field Positions
Write a NEW proofing PDF that draws each defined field as a red-outlined box on the real template, captioned with "<name> (<type>)" in 6pt above the box. This is the tool for debugging coordinate alignment: run it, look at the result, adjust x/y, repeat, and only then call fill_permit_form. It draws NO form_data, so it takes none. Requires reportlab (pip install mcp-pdf[forms]). Supply the definitions through EXACTLY ONE of field_definitions or field_definitions_path; both, or neither, is an error. Same shape fill_permit_form consumes. Boxes come from each field's x, y, width (default 150) an…
| Parameter | Type | Description |
|---|---|---|
template_path * | string | Path to the template PDF, or an HTTPS URL to fetch. Never modified in place. |
field_definitions | The field-definition document as an inline JSON string. Mutually exclusive with field_definitions_path; exactly one of the two is required. Only "pages" and each field's name, x, y, width, height and… | |
field_definitions_path | Local filesystem path to a .json file holding the same document. Not a URL, and it must exist. | |
output_path | Where to write the preview PDF. Overwritten if it exists. When omitted, the PDF comes back as pdf_base64 in the response instead of being written anywhere. |
permitform__validate_permit_form_data Permitform Validate Permit Form Data
Compare a permit form_data payload against a field-definition document before calling fill_permit_form. Read-only, and no PDF is opened. For the rules-based validator that takes a PDF path and its own rule objects, use validate_form_data instead. Supply the definitions through EXACTLY ONE of field_definitions or field_definitions_path; both, or neither, is an error. Same shape fill_permit_form consumes, with the field names under `pages`. What it genuinely reports: - fields defined in the schema but absent from form_data, as missing_optional - keys in form_data that no field defines, as…
| Parameter | Type | Description |
|---|---|---|
form_data * | string | JSON object mapping field name to value, e.g. {"owner": "Jane Roe", "is_repair": true}. Must be a JSON object, not an array. |
field_definitions | The field-definition document as an inline JSON string. Mutually exclusive with field_definitions_path; exactly one of the two is required. Only the "pages" object and each field's "name" and "type" a… | |
field_definitions_path | Local filesystem path to a .json file holding the same document. Not a URL, and it must exist. |
server_info Server Info
Report this PDF server's own identity and runtime configuration: package version (CalVer, YYYY.MM.DD), how many tool mixins loaded successfully, the one-line summary of each, and the three settings read from the environment — max PDF size, the temp/cache directory (PDF_TEMP_DIR) and whether DEBUG logging is on. Useful for version-pinning a bug report, checking where temp files are going, and spotting a mixin that failed to import: a missing entry in the mixins list means its tools are not registered at all. Note max_pdf_size_mb is reported as 0 when MCP_PDF_MAX_SIZE is unset or 0, which mea…
list_capabilities List Capabilities
Return a hand-maintained map of capability area -> representative tool names, as a quick orientation to what this server covers: text extraction and OCR, tables, document analysis, forms, assembly, annotations, image/markdown conversion and structure detection. READ THIS BEFORE RELYING ON IT. The map is a STATIC literal, not introspection of what is registered, and it is out of date in two ways: 1. It covers 8 areas while 14 mixins load, omitting advanced form fields, security analysis, content analysis, PDF utilities, misc tools and permit forms, and it omits individual tools inside the ar…