pdf_to_text
Extract selectable plain text from born-digital PDFs and optionally save it as a .txt file. Use OCR tools for scanned-image PDFs.
Instructions
Extract plain text from a born-digital PDF using PyMuPDF.
**born-digital PDF only** (text that can be selected/copied with a mouse).
Scanned-image PDFs will return an empty string — use ``ocr_document``
for those.
Args:
file_path: Absolute path to the .pdf file.
save_text: If True (default), also writes a .txt file alongside the PDF.
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": {
"file_path": "<file_path>"
},
"name": "pdf_to_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| save_text | No |