Zotero Advanced Search
zotero_advanced_searchFilter Zotero items by multiple structured fields, such as date ranges and item types, combining conditions with AND or OR when text or tag searches fall short.
Instructions
Advanced item search with multiple structured-field conditions joined by AND or OR. Use this when you need to filter by fields that zotero_search_items and zotero_search_by_tag can't express (date ranges, specific itemTypes, etc.). For plain text use zotero_search_items; for tags use zotero_search_by_tag; for topic discovery use zotero_semantic_search. conditions: list of {field, operation, value} dicts (also accepts a JSON string). Common fields: title, creator, date, dateAdded, dateModified, tag, itemType, publicationTitle, abstractNote, collection. Supported operations (exhaustive): is, isNot, contains, doesNotContain, beginsWith, endsWith, isGreaterThan, isLessThan, isBefore, isAfter. For 'added in the last N days', use field='dateAdded' with operation='isAfter' and an ISO date value (e.g. '2026-03-22'). join_mode: 'all' (AND, default) or 'any' (OR). sort_by: dateAdded, dateModified, title, creator, etc. sort_direction: 'asc' (default) or 'desc'. limit: max results (default 50, max 500). include_subcollections: make a 'collection' condition match items anywhere in that collection's subtree, for the is/isNot operations (default False). search_all_libraries: search every accessible library at once, labelling each result with its library; needs the SQLite backend (the default in local mode). 'tag' conditions work; 'collection' conditions and include_subcollections do not. Example: zotero_advanced_search(conditions=[{'field': 'itemType', 'operation': 'is', 'value': 'preprint'}, {'field': 'dateAdded', 'operation': 'isAfter', 'value': '2026-03-22'}], join_mode='all').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return | |
| sort_by | No | Field to sort by (dateAdded, dateModified, title, creator, etc.) | |
| join_mode | No | Whether all conditions must match ("all") or any condition can match ("any") | all |
| conditions | Yes | List of search condition dictionaries, each containing: - field: The field to search (title, creator, date, tag, etc.) - operation: The operation to perform (is, isNot, contains, etc.) - value: The value to search for | |
| sort_direction | No | Direction to sort (asc or desc) | asc |
| search_all_libraries | No | Search every accessible library at once instead of the active one (#163). Requires the SQLite backend; each result is labelled with its source library. A `collection` condition is rejected in this mode — collection keys are per-library — while `tag` conditions work, since Zotero stores tags in one database-wide table shared by every library. | |
| include_subcollections | No | Make a `collection` condition match items filed anywhere in that collection's subtree rather than in it directly. Applies to the `is` and `isNot` operations, which are the membership questions; other operators keep comparing keys as before. Defaults to False, matching Zotero's own "Search subcollections" checkbox. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |