search_document
Search for text within a Word document and retrieve matching paragraphs with surrounding context. Avoid loading the entire file by pinpointing content directly.
Instructions
Search for text in a Word document.
Use this to find specific content without loading the entire document. Returns matching paragraphs with surrounding context.
Args: path: Path to the .docx file query: Text to search for case_sensitive: Match case exactly (default: False) context_paragraphs: Paragraphs to include before/after each match (default: 1) max_results: Maximum matches to return (default: 20) include_annotations: Include comments/track changes on matched paragraphs (default: False)
Returns: Dictionary containing: - query: The search query - case_sensitive: Whether search was case-sensitive - total_matches: Total matches found - matches_returned: Number returned (may be limited) - matches: List with paragraph_index, paragraph_text, paragraph_style, match_start, match_end, context_before, context_after, and optionally comments and track_changes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| query | Yes | ||
| max_results | No | ||
| case_sensitive | No | ||
| context_paragraphs | No | ||
| include_annotations | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||