Skip to main content
Glama

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
NameRequiredDescriptionDefault
item_typeYes
titleYes
creatorsYes
dateNo
doiNo
urlNo
abstractNo
publicationNo
collectionsNo
tagsNo

Implementation Reference

  • 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)
  • 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)}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BirdInTheTree/zotero-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server