Search documents
search_documentsSearch and filter Paperless documents by full text, tags, correspondents, dates, document types, and custom fields to find specific records, or locate documents similar to a given one.
Instructions
Search and filter documents in the archive.
All parameters combine as AND conditions, except that query and
more_like_document_id cannot be used together. query is full-text
search over document contents using tantivy syntax: plain terms ("electric
bill"), boolean operators ("chase AND (mortgage OR escrow)"), field
prefixes ("correspondent:university", "type:invoice", "tag:unpaid",
"created:[2020 to 2023]"), and wildcards ("electr*"). Notes and custom
fields are structured fields with dotted paths: "notes.note:reimbursed",
"custom_fields.value:overdue", "custom_fields.name:warranty". Plain terms
do NOT match them, only titles and content. Full-text results include a
search_hit with highlights.
more_like_document_id finds documents whose text is similar to one
document's, ranked by similarity in search_hit.rank. The results leave
out that document itself, and the other filters narrow them. Leave
ordering unset to keep the ranking.
To find unfiled documents, use is_in_inbox=true, or has_tags, has_correspondent, has_document_type, or has_storage_path set to false.
custom_field_query compares custom field values, like "Amount over 100"
or "Warranty Expires before 2027-01-01". Every field type supports exact,
in, exists, and isnull. Date, integer, float, and monetary fields add gt,
gte, lt, lte, and range. String, URL, long text, and monetary fields add
icontains, istartswith, and iendswith. Document link fields add contains.
Paperless refuses an operator that the field's type does not support.
Each result carries a uri, which you can read as an MCP resource for the
document's full text, and a web_url that links to the document in the
Paperless web UI. Read paperless://documents/{id}/notes for a document's
notes, or call get_document for its notes and custom field values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number, starting at 1 (default: 1) | |
| query | No | Full-text query in tantivy syntax, described above (default: none) | |
| tag_ids | No | Match documents that have ALL of these tags (default: none) | |
| has_tags | No | true matches documents with at least one tag, and false matches documents with no tags (default: none) | |
| ordering | No | Field to sort by. Prefix it with "-" for descending order, like "-created". Without it, full-text results are ranked by relevance (default: none) | |
| page_size | No | Number of documents per page (default: 25) | |
| added_after | No | Match documents added to the archive at or after this ISO 8601 date and time (default: none) | |
| any_tag_ids | No | Match documents that have at least one of these tags (default: none) | |
| is_in_inbox | No | true matches documents with at least one inbox tag, and false matches documents with none (default: none) | |
| added_before | No | Match documents added to the archive at or before this ISO 8601 date and time (default: none) | |
| created_after | No | Match documents dated on or after this date, as YYYY-MM-DD (default: none) | |
| created_before | No | Match documents dated on or before this date, as YYYY-MM-DD (default: none) | |
| title_contains | No | Case-insensitive substring of the title (default: none) | |
| storage_path_id | No | Match documents filed under this storage path (default: none) | |
| content_contains | No | Case-insensitive substring of the text content (default: none) | |
| correspondent_id | No | Match documents from or to this correspondent (default: none) | |
| document_type_id | No | Match documents of this type (default: none) | |
| excluded_tag_ids | No | Match documents that have NONE of these tags (default: none) | |
| has_storage_path | No | true matches documents with a storage path, and false matches documents without one (default: none) | |
| has_correspondent | No | true matches documents with a correspondent, and false matches documents without one (default: none) | |
| has_document_type | No | true matches documents with a document type, and false matches documents without one (default: none) | |
| custom_field_query | No | Conditions on custom field values, described above. Name each field by its ID or exact name from list_custom_fields (default: none) | |
| more_like_document_id | No | Match documents similar to the document with this ID. Cannot be combined with query (default: none) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documents | Yes | ||
| pagination | Yes | The position of one page of results in the full result set. |