Skip to main content
Glama

Zotero Advanced Search

zotero_advanced_search

Filter 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

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It discloses critical behavioral traits: search_all_libraries requires the SQLite backend, labels results with library, and rejects collection conditions while allowing tags; include_subcollections only applies to is/isNot operations; and the JSON-string form for conditions is accepted. These details go well beyond typical descriptions and fully characterize the tool's behavior.

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

Conciseness5/5

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

Though lengthy, the description is tightly organized and front-loaded: purpose, usage guidance, then parameter semantics, concluding with an illustrative example. Every sentence adds necessary information for a complex tool with 7 parameters and 10 operations. No filler or redundancy, so the length is justified by the tool's complexity.

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?

With an output schema present, the description need not cover return values. It covers purpose, alternatives, parameter details, operational constraints, and gives a runnable example. The inclusion of limitations (e.g., collection condition rejected in search_all_libraries) and the SQLite backend requirement rounds out the guidance needed for correct invocation.

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

Parameters5/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds substantial value beyond the schema. It enumerates common fields (title, creator, date, etc.), exhaustively lists supported operations, explains how to express 'added in the last N days' with an ISO date, and clarifies sort direction defaults and the limit cap. It effectively makes the parameters self-documenting.

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?

The description opens with 'Advanced item search with multiple structured-field conditions joined by AND or OR' – a specific verb, resource, and operation. It then explicitly contrasts with siblings: '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.)' and names plain-text, tag, and semantic alternatives. This makes the tool's distinct role unmistakable.

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?

The description gives explicit routing guidelines: 'For plain text use zotero_search_items; for tags use zotero_search_by_tag; for topic discovery use zotero_semantic_search.' It also states when the advanced search is warranted and provides a concrete example call, leaving no ambiguity about when to choose this over siblings.

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