Skip to main content
Glama
54yyyu
by 54yyyu

zotero_advanced_search

Find Zotero items with structured field conditions using AND/OR logic, enabling precise filters like date ranges and item types beyond basic search.

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. Changed5 schema fields changedv0.11.0
    • addedInput schema / properties / conditions / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / conditions / items
      Removed value: -{
      -  "additionalProperties": {
      -    "type": "string"
      -  },
      -  "type": "object"
      -}
    • removedInput schema / properties / conditions / type
      Removed value: -"array"
    • addedInput schema / properties / include_subcollections
      Added value: +{
      +  "default": false,
      +  "description": "Make a `collection` condition match items filed\nanywhere in that collection's subtree rather than in it directly.\nApplies to the `is` and `isNot` operations, which are the\nmembership questions; other operators keep comparing keys as\nbefore. Defaults to False, matching Zotero's own \"Search\nsubcollections\" checkbox.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / search_all_libraries
      Added value: +{
      +  "default": false,
      +  "description": "Search every accessible library at once instead\nof the active one (#163). Requires the SQLite backend; each result\nis labelled with its source library. A `collection` condition is\nrejected in this mode — collection keys are per-library — while\n`tag` conditions work, since Zotero stores tags in one\ndatabase-wide table shared by every library.",
      +  "type": "boolean"
      +}
  2. Addedv0.4.1
  3. Removedv0.1.6
  4. First observedv1.0.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description fully carries the behavioral burden. It discloses that search_all_libraries requires the SQLite backend, labels results with their source library, and that 'collection' conditions are rejected in that mode while 'tag' conditions work. It also clarifies include_subcollections behavior and the exhaustive list of operations. This is rich, specific behavioral disclosure far beyond a generic 'search'.

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?

The description is dense but every sentence earns its place. It front-loads purpose and usage, then walks through parameters in a logical order with an example. There is no fluff—each clause adds a constraint or clarification. 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?

For a complex 7-parameter tool, the description covers all necessary operational details: field-operation pairs, join modes, sort options, limits, subcollection semantics, cross-library behavior with its backend requirement, and even an example invocation. Since an output schema exists, return-value details are not needed. Nothing an agent needs to call this correctly is missing.

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?

Although the schema documents each parameter (100% coverage), the description adds substantial semantic value: it lists common fields (title, creator, date, etc.), the exhaustive supported operations, the exact way to express 'added in the last N days' (field='dateAdded', operation='isAfter', ISO date), and explains that conditions can be a JSON string. This goes well beyond what the schema's terse descriptions provide.

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 a precise statement: 'Advanced item search with multiple structured-field conditions joined by AND or OR.' It names the specific resource (items) and distinguishes itself from siblings by stating what it can express that they cannot (date ranges, specific itemTypes). This is a clear, specific verb+resource with explicit sibling differentiation.

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?

Usage is explicitly spelled out: 'Use this when you need to filter by fields that zotero_search_items and zotero_search_by_tag can't express...' followed by exact routing: 'For plain text use zotero_search_items; for tags use zotero_search_by_tag; for topic discovery use zotero_semantic_search.' This is textbook when-to-use and alternative guidance.

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