Summary
The search tools (search_pdf and search_multiple_pdfs) currently don't effectively encourage users to use regex patterns, which are much more powerful than plain text searches.
Current State
- Tool descriptions mention regex support as
/pattern/flags format
- Users often default to plain text searches
- Missing examples of common regex patterns that would be useful for PDF analysis
Proposed Improvements
1. Enhanced Tool Descriptions
Update tool descriptions to lead with regex capabilities and provide concrete examples:
Current:
Search for text patterns (including regex) within a PDF file...
Proposed:
Search for text patterns using regex or plain text within a PDF file. Supports powerful regex patterns like /budget|forecast/gi (case-insensitive search for budget OR forecast), /\d{4}-\d{2}-\d{2}/g (dates in YYYY-MM-DD format), or /section\s+\d+/i (section numbers). Use plain text for literal searches.
2. Add Common Regex Examples
Include helpful regex patterns in descriptions:
/\$[\d,]+\.?\d*/g - Currency amounts
/\b\d{4}\b/g - Years (4-digit numbers)
/chapter\s+\d+/gi - Chapter references
/table\s+\d+/gi - Table references
/figure\s+\d+/gi - Figure references
/\b[A-Z]{2,}\b/g - Acronyms
/\b\w+@\w+\.\w+/g - Email addresses
3. Parameter Description Updates
Enhance the search_pattern parameter description with:
- Leading with regex capabilities
- Clear format explanation:
/pattern/flags
- Common flags explanation (g, i, m, s)
- Fallback to literal text when not using
/pattern/ format
4. Documentation Examples
Add examples to CLAUDE.md showing:
- How to search for financial data with regex
- How to find structured references (chapters, sections, tables)
- How to extract specific data patterns from documents
Benefits
- More powerful searches leading to better PDF analysis
- Reduced need for multiple search calls
- Better extraction of structured data from documents
- More efficient document processing
Files to Update
src/index.ts - Tool descriptions
server/index.js - Compiled descriptions
manifest.json - DXT tool descriptions
CLAUDE.md - Documentation and examples
Priority
Medium - This would significantly improve the user experience and tool effectiveness without breaking existing functionality.
Summary
The search tools (
search_pdfandsearch_multiple_pdfs) currently don't effectively encourage users to use regex patterns, which are much more powerful than plain text searches.Current State
/pattern/flagsformatProposed Improvements
1. Enhanced Tool Descriptions
Update tool descriptions to lead with regex capabilities and provide concrete examples:
Current:
Proposed:
2. Add Common Regex Examples
Include helpful regex patterns in descriptions:
/\$[\d,]+\.?\d*/g- Currency amounts/\b\d{4}\b/g- Years (4-digit numbers)/chapter\s+\d+/gi- Chapter references/table\s+\d+/gi- Table references/figure\s+\d+/gi- Figure references/\b[A-Z]{2,}\b/g- Acronyms/\b\w+@\w+\.\w+/g- Email addresses3. Parameter Description Updates
Enhance the
search_patternparameter description with:/pattern/flags/pattern/format4. Documentation Examples
Add examples to CLAUDE.md showing:
Benefits
Files to Update
src/index.ts- Tool descriptionsserver/index.js- Compiled descriptionsmanifest.json- DXT tool descriptionsCLAUDE.md- Documentation and examplesPriority
Medium - This would significantly improve the user experience and tool effectiveness without breaking existing functionality.