Skip to main content
Glama

zotero_get_recent

Retrieve recently added items from your Zotero library using customizable limits. Access your latest research entries for quick referencing and review.

Instructions

Get recently added items to your Zotero library.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • Handler function for 'zotero_get_recent' tool. Fetches the most recently added items from the Zotero library using pyzotero, formats them as markdown with metadata like title, type, key, date, added date, and authors (using format_creators helper). Limits results to 100 max, sorts by dateAdded descending.
    name="zotero_get_recent", description="Get recently added items to your Zotero library." ) def get_recent( limit: Union[int, str] = 10, *, ctx: Context ) -> str: """ Get recently added items to your Zotero library. Args: limit: Number of items to return ctx: MCP context Returns: Markdown-formatted list of recent items """ try: ctx.info(f"Fetching {limit} recent items") zot = get_zotero_client() if isinstance(limit, str): limit = int(limit) # Ensure limit is a reasonable number if limit <= 0: limit = 10 elif limit > 100: limit = 100 # Get recent items items = zot.items(limit=limit, sort="dateAdded", direction="desc") if not items: return "No items found in your Zotero library." # Format items as markdown output = [f"# {limit} Most Recently Added Items", ""] for i, item in enumerate(items, 1): data = item.get("data", {}) title = data.get("title", "Untitled") item_type = data.get("itemType", "unknown") date = data.get("date", "No date") key = item.get("key", "") date_added = data.get("dateAdded", "Unknown") # Format creators creators = data.get("creators", []) creators_str = format_creators(creators) # Build the formatted entry output.append(f"## {i}. {title}") output.append(f"**Type:** {item_type}") output.append(f"**Item Key:** {key}") output.append(f"**Date:** {date}") output.append(f"**Added:** {date_added}") output.append(f"**Authors:** {creators_str}") output.append("") # Empty line between items return "\n".join(output) except Exception as e: ctx.error(f"Error fetching recent items: {str(e)}") return f"Error fetching recent items: {str(e)}"
  • FastMCP tool registration for 'zotero_get_recent' with description.
    name="zotero_get_recent", description="Get recently added items to your Zotero library." )
  • Import of format_creators helper used in get_recent to format author names.
    from zotero_mcp.utils import format_creators
  • Import of get_zotero_client used to initialize the pyzotero client in get_recent.
    from zotero_mcp.client import ( convert_to_markdown, format_item_metadata, generate_bibtex, get_attachment_details, get_zotero_client, )

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/54yyyu/zotero-mcp'

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