search_pdf_text
Search for text in a PDF file and retrieve matching locations and surrounding context. Specify a query and optional page range to limit results.
Instructions
在PDF中搜索文本,返回匹配位置和上下文。
Args: file_path: PDF文件的完整路径 query: 搜索关键词 pages: 搜索的页码范围(可选,默认全部页面) max_results: 最大返回结果数,默认50
Returns: 包含以下信息的字典: - query: 搜索关键词 - total_matches: 匹配总数 - pages_with_matches: 有匹配的页码列表 - results: 匹配结果列表,每个包含: - page: 页码 - context: 匹配的上下文文本
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pages | No | ||
| query | Yes | ||
| file_path | Yes | ||
| max_results | No |