doc_text
Extract text from PDFs or documents by page, or search with regular expressions to return page numbers and short context windows for quick document lookups.
Instructions
Extract the text of a PDF (or read a text document), per page, or search it. With find, the answer is the matches alone: a page number and a short window per hit, so a lookup costs a few hundred tokens; add pages to read a page around a hit. Pages that are drawings or scanned images come back empty; use doc_page to look at those.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Document id, library file name, title, or a path inside the workspace. | |
| find | No | Regular expression to locate in the text; matches come back with page numbers and one context window each (overlapping windows merged), and no page text unless pages is given. | |
| pages | No | Pages to return, e.g. '3-5,12'. Without find: default all, capped to keep the answer readable. With find: default none, only the matches come back. | |
| max_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | ||
| text | Yes | Extracted text per page; empty for image-only pages, which doc_page can render. | |
| pages | Yes | ||
| matches | No | ||
| truncated | No |