search_text
Finds a literal word or phrase in a PDF and returns each match's page, surrounding snippet, and page-coordinate rectangles, with optional page range, case, whole-word, and result limits.
Instructions
Find a word or phrase in a PDF's text (literal text, not a pattern), on all pages or a page spec (e.g. "1-3,7"). Each match has its page, the matched text, a snippet of the text around it, and its rectangles on the page ([left, bottom, right, top] in PDF points, in the page's own coordinates before rotation; one or more per line).
The query is normalized (NFKC; whitespace runs count as one space; surrounding spaces are ignored, so use whole_word to match whole words only). A space can match across a line break. Matching ignores case (simple case folding) unless match_case. Emoji and other characters beyond U+FFFF can't be searched.
Returns up to max_results (1-1000) in page order; truncated means there are more. pages_without_text lists pages with no extractable text (e.g. scans; ocr_pdf makes them searchable); pages_skipped lists pages with too much content to search safely; complete is false if the 60 s time limit stopped the search early. Needs the owner password if the PDF forbids copying.
Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.
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": {
"input_path": "<input_path>",
"query": "<query>"
},
"name": "search_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | ||
| query | Yes | ||
| password | No | ||
| input_path | Yes | ||
| match_case | No | ||
| whole_word | No | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| query | Yes | ||
| matches | Yes | ||
| complete | Yes | ||
| truncated | Yes | ||
| match_count | Yes | ||
| pages_skipped | Yes | ||
| pages_searched | Yes | ||
| pages_without_text | Yes |