remove_from_collection
Remove a Zotero item from a collection without deleting it. Manage your research library by organizing items across collections.
Instructions
Remove a Zotero item from a collection (does not delete the item)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_key | Yes | ||
| collection_key | Yes |
Implementation Reference
- src/zotero_mcp/server.py:176-180 (handler)The MCP tool 'remove_from_collection' is registered here and delegates the work to the client.
@mcp.tool(description="Remove a Zotero item from a collection (does not delete the item)") def remove_from_collection(item_key: str, collection_key: str) -> str: """Remove item from a collection without deleting it.""" _get_client().remove_from_collection(item_key, collection_key) return json.dumps({"item_key": item_key, "removed_from": collection_key}, ensure_ascii=False) - src/zotero_mcp/client.py:300-308 (handler)The actual logic to remove an item from a Zotero collection by modifying the 'collections' list of the item and updating the item in Zotero.
def remove_from_collection(self, item_key: str, collection_key: str) -> bool: """Remove item from a collection. Returns True on success.""" item = self.zot.item(item_key) cols = item["data"].get("collections", []) if collection_key in cols: cols.remove(collection_key) item["data"]["collections"] = cols self.zot.update_item(item) return True