Index PDF Document
index_documentConvert a local PDF into a hierarchical PageIndex tree for navigation and content extraction without LLM calls during search.
Instructions
Converts a local PDF into a PageIndex hierarchical tree structure. This is a one-time operation per document. Requires: PAGEINDEX_REPO_PATH env var pointing to cloned VectifyAI/PageIndex repo, and OPENAI_API_KEY for tree generation.
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": {
"pdf_path": "<pdf_path>",
"doc_id": "<doc_id>"
},
"name": "index_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Unique identifier for this document (alphanumeric, hyphens, underscores) | |
| pdf_path | Yes | Absolute path to the PDF file on local filesystem | |
| toc_check_pages | No | Pages to scan for table of contents (default: 20) | |
| max_pages_per_node | No | Max pages per tree node (default: 10) |