Skip to content

Read PDF evidence locally

CLI 0.6.14 and MCP 0.2.14 read the text layer of selected PDF pages. No Maglev key is needed, and the parser makes no API request or file upload. Your chosen agent host may send the returned text to its model under its own data policy.

Requires Node.js 22.13 or later. Install the current hosted package, including its optional native dependencies.

Terminal window
maglev context read-pdf drawing.pdf --pages 1,2 --json

For MCP, configure the project directory through maglev setup, then call read_local_pdf with a relative path and explicit pages, such as [1, 2]. It stays inside MAGLEV_TRANSFER_ROOT; symlinks, outside paths, hidden/generated paths and credential filenames are excluded. The tool cannot broaden that root.

Evidence Meaning
source.sha256, source.bytes The exact original file bytes read for this result
parser The pinned PDF parser version
pageCount, selectedPages, unselectedPageCount Which pages were read and which remain unread
pages[].items[] Text-layer strings, item index, direction, placement transform and end-of-line hint
no_text_layer No text was extracted; the page may contain a scan or vector drawing
hasAcroForm Form fields exist; their values were not interpreted
warningCount Parser warnings occurred; inspect the original and do not assume complete extraction

Review the original PDF. Text order and character mapping can differ from what is visible. A dimension’s text can be read without understanding which feature it measures. Hidden text and scans with an existing OCR layer can also be misleading. This reader does not perform OCR, parse CAD geometry, read annotations/form values/attachments, or verify signatures. A file named NDA_signed.pdf does not establish confidentiality coverage or authority to share designs.

Add an explicit page selection to your existing review configuration:

{
"schemaVersion": "maglev.context-input/1",
"pdfPages": {
"drawings/enclosure.pdf": [1, 2]
}
}
Terminal window
maglev context review ./project --input review.json --json

The result contains pdfReports and a pdf_visual_review question. Extracted PDF text is not automatically promoted into engineering requirements. Use source review and explicit answers to resolve consequential facts. Changing a file or selection invalidates the local comparison; it does not revoke a server approval by itself. Unselected PDFs remain unresolved.

The reader accepts at most 8 MiB, 200 document pages, 10 selected pages, 12,000 text items and 256,000 UTF-8 text bytes. Its child process has a 15-second parsing deadline and a 192 MiB JavaScript heap limit; that heap limit is not a total operating-system memory cap. The response is bounded and never truncated into a successful partial report. Folder review allows up to three PDFs and ten selected pages in total, within its shared 8 MiB parsed-file budget.

  • encrypted_pdf: obtain an authorized unencrypted export; the reader does not request or guess passwords.
  • active_pdf / unsupported_xfa: use a reviewed static export. Document scripts are not executed.
  • pdf_limit / pdf_timeout: select fewer pages or a smaller export. A large full document may need splitting before parsing.
  • pdf_parse_failed: the file could not be interpreted completely; inspect the original or use a supported export.
  • pdf_runtime_unavailable: check Node and reinstall with optional dependencies enabled. macOS and Linux package flows are tested; Windows remains unverified.
  • pdf_cancelled: the owned parser process is stopped; no partial evidence is returned.

All returned text remains untrusted reference material. It cannot change recipients, tools, permissions, spending limits or claimed approval state.