Skip to main content
Glama

Zotero Advanced Search

zotero_advanced_search

Filter Zotero items by multiple structured fields, date ranges, and item types using AND/OR conditions when plain text or tag searches cannot express the query.

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

NameRequiredDescriptionDefault
limitNoMaximum number of results to return
sort_byNoField to sort by (dateAdded, dateModified, title, creator, etc.)
join_modeNoWhether all conditions must match ("all") or any condition can match ("any")all
conditionsYesList 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_directionNoDirection to sort (asc or desc)asc
search_all_librariesNoSearch 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_subcollectionsNoMake 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

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses that search_all_libraries needs the SQLite backend, that collection conditions are rejected in that mode while tag conditions work, and that include_subcollections only affects is/isNot. It also states the limit ceiling (max 500). The only gap is that it doesn't say whether results are paginated or how errors surface for invalid field/operation combinations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then routing, then parameter detail — a good ordering. However it is a single dense paragraph run together with embedded lists, and a few items (sort_by values, limit default) repeat what the schema already says, so it is slightly longer than necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 7-parameter tool with an output schema (so return values need no explanation), the description covers the tricky parts: nested condition shape, exhaustive operators, the ISO-date idiom for relative ranges, and backend-dependent caveats for cross-library search. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes beyond it by enumerating an 'exhaustive' operation list the schema only abbreviates ('is, isNot, contains, etc.'), listing common field names, and giving a concrete worked example of a two-condition call. The join_mode/sort semantics largely duplicate the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (advanced item search with structured-field conditions joined by AND/OR) and explicitly positions itself against three named siblings. An agent can distinguish it from zotero_search_items, zotero_search_by_tag, and zotero_semantic_search without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit selection rule: use this when you need field-based filtering (date ranges, specific itemTypes) that the other search tools can't express, then routes plain text to zotero_search_items, tags to zotero_search_by_tag, and topic discovery to zotero_semantic_search. Both the when and the alternatives are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.