pdf_to_markdown
Convert PDFs into structured Markdown, preserving headings, lists, tables, and reading order so models can reliably read and analyze document content.
Instructions
Read a PDF's text as Markdown, keeping its structure for a model to read: headings (#, ##, ### from font sizes larger than the body text; a short bold line on its own becomes the next level down), bulleted and numbered lists, paragraphs (lines joined, words hyphenated at line breaks mended), and tables as Markdown tables (unless include_tables=false). Text is read in reading order, following columns. On all pages or a page spec (e.g. "1-3,7"); page_markers adds "" before each page.
Text from the PDF is escaped, so it can't add hidden links, pictures, HTML or formatting (a web address written out in it stays as written, and some viewers show it as a link); only the unescaped "" lines are page markers, and invisible characters are removed. Structure is inferred from the layout, so check headings and lists that matter (with view_pages). Returns up to max_chars (1-1,000,000) characters, cut at the end of a block (or within one too long to fit); truncated means there is more (export_markdown saves up to 4 million characters). Pages with no text (e.g. scans; ocr_pdf makes them readable) are listed in pages_without_text; pages that can't be read safely in pages_skipped, with the reason; complete is false if the 60 s limit per call stopped it before every page was read. Needs the owner password if the PDF forbids copying.
Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_path": "<input_path>"
},
"name": "pdf_to_markdown"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | ||
| password | No | ||
| max_chars | No | ||
| input_path | Yes | ||
| page_markers | No | ||
| include_tables | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| tables | Yes | ||
| complete | Yes | ||
| headings | Yes | ||
| markdown | Yes | ||
| truncated | Yes | ||
| characters | Yes | ||
| pages_read | Yes | ||
| pages_skipped | Yes | ||
| pages_without_text | Yes |