Update a Zotero item
zotero_update_itemPartially update a Zotero item by supplying only the fields to change (PATCH), preserving others. Handles concurrency automatically; use dry_run to preview the before-after diff.
Instructions
Partially update one item (HTTP PATCH — only the fields you supply change; omitted fields are preserved). Provide item_key and a patch object of the fields to change (e.g. {"title":"New","extra":"note"} or {"tags":[{"tag":"reviewed"}]}). All field values are plain JSON strings/numbers/booleans/arrays — never wrapped in nested objects (e.g. "title": "New", NOT "title": {"title": "New"}). Optimistic concurrency is handled for you: if you pass the item's version it is used; otherwise the current version is fetched first. If the item changed on the server in the meantime (412), the update is automatically re-fetched and retried once. Writes go to the cloud Web API. Set dry_run:true to preview the field-level before→after diff without writing (arrays like tags/collections are replaced wholesale by PATCH, not merged; a dry_run call performs no write).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Object of fields to change (PATCH semantics), e.g. {"title": "New title", "date": "2024-02-01", "tags": [{"tag": "reviewed"}], "collections": ["ABCD1234"]}. Structured fields (creators, tags, collections, relations) must be real JSON arrays/objects, not JSON-encoded strings. Values are plain, never wrapped in nested objects. | |
| dry_run | No | Preview the field-level before→after diff without writing. | |
| version | No | Known current version; fetched automatically if omitted. | |
| item_key | Yes | The 8-character item key. | |
| library_id | No | 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. | |
| library_type | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diff | No | Field-level before/after for a dry run; only fields the patch would actually change. | |
| dryRun | No | True when nothing was written. | |
| retried | No | True when a version conflict (412) was re-fetched and retried once. | |
| version | No | Current version on the server (dry run only). | |
| item_key | Yes | The item this call addressed. | |
| newVersion | No | Version after the PATCH; absent on a dry run. | |
| arrayReplacements | No | Fields in that diff that PATCH replaces wholesale rather than merging, e.g. ["tags"]. |