Extract PDF tables to CSV
extract_pdf_tablesExtract rows and columns from local text-based PDFs into CSV text or saved CSV files for spreadsheets, pandas, or databases. Use for bordered or spacing-aligned tables; scanned PDFs are skipped.
Instructions
Pull the tables out of a local text PDF.
Use this when you need the rows and columns of a table from a PDF on this computer, for example to load them into a spreadsheet, pandas or a database. Do not use it for scanned PDFs or photos (there is no OCR), for PDFs on the web (download the file first), or when you want the whole document as text (use a PDF-to-Markdown or text tool instead).
path: full path to a PDF on this computer. pages: optional, like "1,3-5". Empty means all pages. strategy: "auto" (default, tries borders first, then spacing), "lines" (tables with ruled borders) or "text" (tables lined up by spacing). Try "text" if "auto" misses a table that has no border lines. output_dir: optional. If set, each table is saved there as a CSV and the file paths are returned. Files named pageN_tableM.csv that already exist there are replaced. If empty, nothing is written and the CSV text of each table is returned.
Scanned (image-only) pages have no text and are skipped. Returns [] if no tables.
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": {
"path": "<path>"
},
"name": "extract_pdf_tables"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| pages | No | ||
| strategy | No | auto | |
| output_dir | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |