create_item
Add new bibliographic entries to Zotero by specifying item type, title, creators, and optional metadata like DOI, URL, or collections.
Instructions
Create a new item in Zotero
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_type | Yes | ||
| title | Yes | ||
| creators | Yes | ||
| date | No | ||
| doi | No | ||
| url | No | ||
| abstract | No | ||
| publication | No | ||
| collections | No | ||
| tags | No |
Implementation Reference
- src/zotero_mcp/server.py:113-132 (registration)MCP tool registration for create_item.
@mcp.tool(description="Create a new item in Zotero") def create_item( item_type: str, title: str, creators: list[dict], date: str = "", doi: str = "", url: str = "", abstract: str = "", publication: str = "", collections: list[str] | None = None, tags: list[str] | None = None, ) -> str: """Create a Zotero item. creators format: [{"type":"author","firstName":"...","lastName":"..."}]""" key = _get_client().create_item( item_type, title, creators, date, doi, url, abstract, publication, collections, tags, ) return json.dumps({"key": key}, ensure_ascii=False) - src/zotero_mcp/client.py:156-200 (handler)Implementation of create_item logic in ZoteroClient.
def create_item( self, item_type: str, title: str, creators: list[dict], date: str = "", doi: str = "", url: str = "", abstract: str = "", publication: str = "", collections: list[str] | None = None, tags: list[str] | None = None, ) -> str: """Create a new Zotero item. Returns the item key.""" template = self.zot.item_template(item_type) template["title"] = title template["creators"] = creators if date: template["date"] = date if doi: template["DOI"] = doi if url: template["url"] = url if abstract: template["abstractNote"] = abstract if publication: pub_field = { "journalArticle": "publicationTitle", "conferencePaper": "conferenceName", "bookSection": "bookTitle", }.get(item_type, "publicationTitle") template[pub_field] = publication if collections: template["collections"] = collections if tags: template["tags"] = [{"tag": t} for t in tags] resp = self.zot.create_items([template]) created = resp.get("successful", resp.get("success", {})) if created: key = list(created.values())[0] if isinstance(created, dict) else created[0] if isinstance(key, dict): return key.get("key", key.get("data", {}).get("key", "")) return str(key) raise RuntimeError(f"Failed to create item: {resp.get('failed', resp)}")