get_item
Retrieve complete metadata for a Zotero library item including title, authors, abstract, publication details, and related collections using its unique identifier.
Instructions
Get full metadata for a single Zotero item.
Args: item_key: The Zotero item key
Returns: JSON with complete item metadata including title, creators, abstract, date, DOI, URL, tags, and collections.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_key | Yes |
Implementation Reference
- src/zoty/server.py:62-72 (handler)The MCP tool handler for 'get_item'. This function is decorated with @mcp_server.tool() which registers it as an MCP tool. It takes an item_key parameter and delegates to db.get_item() for the actual implementation.
@mcp_server.tool() def get_item(item_key: str) -> str: """Get full metadata for a single Zotero item. Args: item_key: The Zotero item key Returns: JSON with complete item metadata including title, creators, abstract, date, DOI, URL, tags, and collections. """ return db.get_item(item_key) - src/zoty/db.py:217-225 (helper)The core implementation logic for get_item. Fetches a single Zotero item by key using pyzotero, handles errors, and returns the item metadata as JSON.
def get_item(item_key: str) -> str: """Full metadata for a single item.""" try: zot = _get_zot() item = zot.item(item_key) except Exception as e: return json.dumps({"error": f"Failed to fetch item {item_key}: {e}"}) return json.dumps(_item_to_dict(item, truncate_abstract=0)) - src/zoty/server.py:14-14 (registration)Creates the FastMCP server instance 'mcp_server' which is used to register all MCP tools via the @mcp_server.tool() decorator.
mcp_server = FastMCP(MCP_SERVER_NAME)