search_document_content
Find specific text in a document by searching for a snippet, returning matching lines with line numbers and surrounding context. Helps locate exact positions without reading the full document.
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
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": {
"document_id": "<document_id>",
"query": "<query>"
},
"name": "search_document_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| document_id | Yes | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |