search_items
Find items in your Zotero library using search queries and filters for collections, item types, or tags to locate specific references.
Instructions
Search items in Zotero library with optional filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| collection_key | No | ||
| item_type | No | ||
| tag | No | ||
| limit | No |
Implementation Reference
- src/zotero_mcp/server.py:56-65 (handler)The MCP tool definition for 'search_items' which calls the ZoteroClient.
def search_items( query: str, collection_key: str = "", item_type: str = "", tag: str = "", limit: int = 25, ) -> str: """Search for items by keyword with optional collection, type, and tag filters.""" results = _get_client().search_items(query, collection_key, item_type, tag, limit) return json.dumps(results, ensure_ascii=False) - src/zotero_mcp/client.py:34-54 (handler)The implementation of the search logic in ZoteroClient using pyzotero.
def search_items( self, query: str, collection_key: str = "", item_type: str = "", tag: str = "", limit: int = 25, ) -> list[dict]: """Full-text search with optional filters.""" kwargs = {"q": query, "limit": limit, "itemType": "-attachment || note"} if item_type: kwargs["itemType"] = item_type if tag: kwargs["tag"] = tag if collection_key: items = self.zot.collection_items(collection_key, **kwargs) else: items = self.zot.items(**kwargs) return [self._format_item_summary(item) for item in items]