search_document_content
Search a document for specific text and return matching lines with line numbers and surrounding context to locate information or prepare edits.
Instructions
Searches within a document for lines containing a
text snippet (grep-style), returning matches with
line numbers and surrounding context.
Use this tool when you need to:
- Locate specific text in a large document without
reading it in full
- Find the exact text and line number to build
edit_document old_string values or
read_document offsets
Matching is case-insensitive per line. Line numbers
are 0-based and valid as read_document offsets.
Args:
document_id: The document ID to search
query: Text snippet to find (case-insensitive)
context_lines: Lines of context around each
match (default: 2, must be non-negative)
Returns:
Matching lines with line numbers and context
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| query | Yes | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |