Search PDF Text
search_textSearch for text in a PDF file with case-insensitive matching. Specify a page range or search the entire document to get matches with surrounding context and page numbers.
Instructions
Search for text within a PDF document. Returns matching locations with surrounding context.
Case-insensitive search across all or specified pages. Each match includes the page number, the matched text, and configurable surrounding context.
Args:
file_path (string): Absolute path to a local PDF file
query (string): Text to search for (case-insensitive, 1-500 chars)
pages (string, optional): Page range to search. Omit for all pages.
context_chars (number): Characters of context before/after match (default: 80)
max_results (number): Maximum matches to return (default: 20, max: 100)
response_format ('markdown' | 'json'): Output format (default: 'markdown')
Returns: Search matches with page number, matched text, and surrounding context.
Examples:
Search entire PDF: { file_path: "/path/to/doc.pdf", query: "digital signature" }
Search specific pages: { file_path: "/path/to/doc.pdf", query: "error", pages: "1-10" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to a local PDF file (e.g., "/path/to/document.pdf") | |
| query | Yes | Text to search for (case-insensitive) | |
| pages | No | Page range to process. Format: "1-5", "3", or "1,3,5-7". Omit for all pages. | |
| context_chars | No | Number of characters to show before and after each match | |
| max_results | No | Maximum number of matches to return | |
| response_format | No | Output format: "markdown" for human-readable, "json" for structured data | markdown |