search_passages
Find full-text matches across Paperless documents and return bounded text passages around each hit, so you can locate and skim evidence without flooding context.
Instructions
Search documents full-text and return bounded text passages around each hit instead of whole documents. The window is anchored on the server's own highlighted phrase (falling back to the LONGEST matching query term, then the document head), so the returned passage contains the actual hit even when stemming matched a word variant. Queries that the server rejects with an HTTP 400 are retried once with a defensively rewritten query (apostrophes and stray quotes removed); such responses carry query_sanitized: true. Returns document id, title, score, offset, content_length, and the highlighted snippet. Use this to locate and skim evidence across many documents without flooding context; page further with get_document_content offsets.
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": {
"query": "<query>"
},
"name": "search_passages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | ||
| query | Yes | Full-text query (same syntax as query_documents). | |
| window | No | Characters per passage (default 800). | |
| ordering | No | ||
| page_size | No | ||
| max_passages | No | Maximum passages to return (default 5). | |
| storage_path | No | ||
| correspondent | No | ||
| document_type | No | ||
| paperless_filters | No | ||
| created__date__gte | No | ||
| created__date__lte | No | ||
| custom_fields__icontains | No |