PDFluent

v0.3.2
io.github.pdfluent/pdfluent-mcp Checked 1 day ago Published 7 days ago

Read, search and fill PDFs as markdown, text, tables, forms.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

extract_markdown

A local PDF as markdown, in reading order. Headings become ``#`` to ``###``, list items ``-`` and ``1.``, a table a pipe table (or HTML where markdown cannot hold its shape), and a change of page an HTML comment. Running heads and page numbers are left out. Args: path: The PDF's absolute path on this machine. pages: The 0-based pages to return; omit for the whole document, up to the server's page limit. The whole document is still read, because what a block is gets decided against the rest of it. quality: ``"fast"`` (default) or…

ParameterTypeDescription
path *string
pages
qualitystring

extract_text

The plain text layer of a local PDF, page by page. Each page starts with ``<!-- page N -->`` (N 0-based). No reading-order repair and no structure: use extract_markdown for that. A page with no text layer (a scan) yields nothing here; get_metadata names those pages. Args: path: The PDF's absolute path on this machine. pages: The 0-based pages to return; omit for the whole document, up to the server's page limit.

ParameterTypeDescription
path *string
pages

extract_tables

The tables of a local PDF as rows of cell text. ``tables`` holds one entry per table in reading order: ``page`` (0-based), ``rows`` (a list of rows, each a list of cell strings, every row the table's width) and ``header_rows`` (how many leading rows are header rows). A spanning cell sits at its first row and column; the cells it covers are empty strings. Args: path: The PDF's absolute path on this machine. pages: The 0-based pages to look at; omit for the whole document, up to the server's page limit.

ParameterTypeDescription
path *string
pages

extract_blocks

A local PDF as blocks, in reading order, with where each one came from. Each block has ``kind`` (paragraph, heading, list_item, table_cell, header, footer), ``text``, ``page`` (0-based), ``bbox`` ([x0, y0, x1, y1] in PDF points, origin bottom-left) and ``confidence``: the probability of the learned model that decided the block's kind, or null where no model did -- null means unknown, not low. Headings carry ``level``, list items ``level`` and ``ordinal``, table cells ``row``, ``column``, ``row_span``, ``column_span`` and ``header``. ``pages_needing_vision`` li…

ParameterTypeDescription
path *string
include_furnitureboolean
pages

get_metadata

What a local PDF is, before reading it. ``pages``, ``title``, ``author``, ``subject``, ``created``, ``modified``, ``format`` (the PDF version), ``encrypted`` with the ``encryption`` filter name, ``has_forms`` with the ``form_fields`` count, the number of ``signatures`` and ``bookmarks``, and ``pages_needing_vision``: the 0-based pages that draw ink but carry no text layer. A document that needs a password to open answers ``encrypted: true`` and ``needs_password: true`` and nothing else. Args: path: The PDF's absolute path on this machine.

ParameterTypeDescription
path *string

list_form_fields

The interactive form fields of a local PDF. ``fields`` holds one entry per field: ``name`` (the fully qualified name fill_form takes), ``type`` (text, button, choice, signature or unknown), ``value`` (the current value, or null) and ``page`` (0-based, or null when the field has no widget on a page). An empty list means the document has no AcroForm fields. Args: path: The PDF's absolute path on this machine.

ParameterTypeDescription
path *string

fill_form

Fill the form fields of a local PDF and write the result to a new file. ``values`` maps a field name from list_form_fields to its new value: a string for a text field, a check box or a combo box, a list of strings for a multi-select list box. The input file is never changed; ``out_path`` must be a different path inside an allowed root, and one that does not exist yet unless ``overwrite`` is true. A symbolic link at ``out_path`` is refused either way. The result names the fields that were ``set`` and the names that were ``unknown``; nothing is written when no field…

ParameterTypeDescription
out_path *string
path *string
values *object
overwriteboolean

vision_advice

Which pages of a local PDF are worth sending to a vision model, and why. ``advice`` holds one entry per page. ``needs_vision`` is true when any reason holds. Today only ``no_text_layer`` is measured -- the page draws ink but yields no text, as a scan does; ``low_confidence_table`` and ``figure`` are always false until the engine can measure them. Args: path: The PDF's absolute path on this machine.

ParameterTypeDescription
path *string