Skip to main content
Glama

Create or update Zotero items

zotero_create_items
Destructive

Batch-create or update Zotero items with automatic schema validation, ensuring all-or-nothing writes.

Instructions

Create new items or update existing ones in a single batch (the server auto-chunks into groups of 50). items is an ARRAY of item-data objects; each object has itemType as a plain string (e.g. "journalArticle", "book", "preprint", "report") plus its valid fields, creators (each {creatorType, firstName, lastName} or {creatorType, name}), tags ([{tag}]), and collections (array of 8-char collection keys). To UPDATE an existing item, also include its key and current version; to CREATE, omit both. Every item is validated against the Zotero schema before anything is sent — if any item is invalid, nothing is written and the problems are returned. Use zotero_schema to discover valid fields/creator types for an itemType. Writes go to the cloud Web API (requires ZOTERO_API_KEY). To write to a GROUP library, pass its numeric library_id (from zotero_groups) together with library_type:"group". library_type alone is not enough, and the key needs write access to that group. Collection keys are per-library, so take them from zotero_list_collections with the same library_id.

Example:

{"items": [{"itemType": "journalArticle", "title": "The Role of Metadata in Machine Learning", "creators": [{"creatorType": "author", "firstName": "Ada", "lastName": "Lovelace"}], "date": "2024-01-15", "DOI": "10.1234/example.5678", "tags": [{"tag": "ml"}], "collections": ["ABCD1234"]}]}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesArray of Zotero item-data objects (itemType + fields; include key+version to update). Example: {"items":[{"itemType":"journalArticle","title":"The Role of Metadata in Machine Learning","creators":[{"creatorType":"author","firstName":"Ada","lastName":"Lovelace"}],"date":"2024-01-15","DOI":"10.1234/example.5678","tags":[{"tag":"ml"}],"collections":["ABCD1234"]}]}
library_idNoNumeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id.
library_typeNoWhich library to address: "user" (a personal library) or "group" (a shared group library). Omit to use the library this server is configured for. "group" on its own is refused: pass library_id with it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
failedNoOne entry per object the write could not land; absent or empty when all of them did.
createdYesOne entry per item Zotero accepted, created or updated.
libraryVersionNoThe library's Last-Modified-Version after this write.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.21.0
    • addedInput schema / properties / library_id / exclusiveMinimum
      Added value: +0
  2. Changed2 schema fields changedv1.20.2
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Changed3 schema fields changedv1.20.0
    • addedInput schema / properties / library_id / description
      Added value: +"Numeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id."
    • addedInput schema / properties / library_type / description
      Added value: +"Which library to address: \"user\" (a personal library) or \"group\" (a shared group library). Omit to use the library this server is configured for. \"group\" on its own is refused: pass library_id with it."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "created": {
      +      "description": "One entry per item Zotero accepted, created or updated.",
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "key": {
      +            "description": "Key of the item written.",
      +            "type": "string"
      +          },
      +          "version": {
      +            "description": "Its version after the write.",
      +            "type": "number"
      +          }
      +        },
      +        "required": [
      +          "key"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "failed": {
      +      "description": "One entry per object the write could not land; absent or empty when all of them did.",
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "code": {
      +            "description": "Zotero status for this object, e.g. 400 or 412.",
      +            "type": "number"
      +          },
      +          "index": {
      +            "description": "Position of the failed object in the request.",
      +            "type": "number"
      +          },
      +          "key": {
      +            "description": "Item key, when the failed object named one.",
      +            "type": "string"
      +          },
      +          "message": {
      +            "description": "Why Zotero refused it.",
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "libraryVersion": {
      +      "description": "The library's Last-Modified-Version after this write.",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "created"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changedv1.3.1
    • changedInput schema / properties / items / description
      Previous value: -"Array of Zotero item-data objects (itemType + fields; include key+version to update)."New value: +"Array of Zotero item-data objects (itemType + fields; include key+version to update). Example: {\"items\":[{\"itemType\":\"journalArticle\",\"title\":\"The Role of Metadata in Machine Learning\",\"creators\":[{\"creatorType\":\"author\",\"firstName\":\"Ada\",\"lastName\":\"Lovelace\"}],\"date\":\"2024-01-15\",\"DOI\":\"10.1234/example.5678\",\"tags\":[{\"tag\":\"ml\"}],\"collections\":[\"ABCD1234\"]}]}"
    • addedInput schema / properties / items / items / properties / itemType
      Added value: +{
      +  "description": "The Zotero item type as a plain string, e.g. \"journalArticle\", \"book\", \"preprint\", \"report\", \"thesis\".",
      +  "type": "string"
      +}
  5. First observedv1.0.4

TDQS

A4.6/5.0
Behavior5/5

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

Adds substantial behavioral detail beyond the annotations: all-or-nothing validation before any write, auto-chunking into 50-item groups, ZOTERO_API_KEY requirement, per-library collection keys, and group write-access requirements. This complements destructiveHint=true rather than repeating it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but dense and well-structured. Each section—item shape, create/update distinction, validation, authentication, library targeting, example—earns its place. Minor redundancy with the schema example is acceptable.

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?

Even with an output schema present, the description covers authentication, atomic validation, library addressing, item construction, and related tool usage. An agent has enough context to invoke this safely and correctly without external documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds real meaning: key+version distinguishes update from create, library_id and library_type interplay is explained, and validation semantics are clarified. The JSON example further anchors parameter usage.

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?

States specific verbs 'Create new items or update existing ones in a single batch', clearly identifying the resource and behavior. It also distinguishes itself by noting server-side auto-chunking into groups of 50 and covering both create and update paths.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit routing guidance: use zotero_schema for valid fields/creator types, zotero_groups for group library ids, and zotero_list_collections for collection keys. It also clarifies the group-write condition and that library_type alone is refused. It does not explicitly contrast with zotero_update_item or zotero_import, but context is strong.

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