update_item
Modify existing Zotero bibliographic entries by updating specific fields to maintain accurate research references.
Instructions
Update fields on an existing Zotero item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_key | Yes | ||
| fields | Yes |
Implementation Reference
- src/zotero_mcp/server.py:152-156 (handler)MCP tool handler that exposes update_item to the MCP protocol.
@mcp.tool(description="Update fields on an existing Zotero item") def update_item(item_key: str, fields: dict) -> str: """Update item metadata. Uses read-modify-write with version check.""" result = _get_client().update_item(item_key, fields) return json.dumps(result, ensure_ascii=False) - src/zotero_mcp/client.py:269-275 (handler)Core logic for updating a Zotero item using the pyzotero client.
def update_item(self, item_key: str, fields: dict) -> dict: """Update item fields with version check. Returns {key, version}.""" item = self.zot.item(item_key) for field, value in fields.items(): item["data"][field] = value self.zot.update_item(item) return {"key": item_key, "version": item["data"].get("version", 0)}