Search inside a PDF
pdf_searchFind text in a local PDF and return matching pages with surrounding context. Use it first on long documents to avoid costly full-text extraction.
Instructions
Find text inside a local PDF and return matching pages with surrounding context. Much cheaper than pdf_extract when you only need to locate something — use this first on long documents, then pdf_extract with the pages it reports.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path, or path relative to an allowed root, of a .pdf file | |
| query | Yes | Literal text to find, or a regular expression when `regex` is true | |
| regex | No | Treat `query` as a JavaScript regular expression. Defaults to false. | |
| maxMatches | No | Maximum matches to return. Defaults to 25. | |
| contextChars | No | Characters of surrounding context per match. Defaults to 200. |