Skip to main content
Glama

add_to_collections

Organize Zotero references by adding items to specific collections for better research management and structured bibliographies.

Instructions

Add a Zotero item to one or more collections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
item_keyYes
collection_keysYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool registration for add_to_collections, which calls the ZoteroClient implementation.
    @mcp.tool(description="Add a Zotero item to one or more collections")
    def add_to_collections(item_key: str, collection_keys: list[str]) -> str:
        """Add an item to multiple collections at once."""
        cols = _get_client().add_to_collections(item_key, collection_keys)
        return json.dumps({"item_key": item_key, "collections": cols}, ensure_ascii=False)
  • Implementation of the add_to_collections logic which updates the Zotero item's collection list via the pyzotero client.
    def add_to_collections(self, item_key: str, collection_keys: list[str]) -> list[str]:
        """Add item to one or more collections. Returns updated collection list."""
        item = self.zot.item(item_key)
        existing = set(item["data"].get("collections", []))
        existing.update(collection_keys)
        item["data"]["collections"] = list(existing)
        self.zot.update_item(item)
        return item["data"]["collections"]
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but doesn't reveal critical traits: whether this is a mutation (implied by 'Add'), what permissions are required, if it's idempotent (e.g., adding to already-associated collections), error conditions (e.g., invalid keys), or side effects. The description is minimal and lacks operational context.

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

Conciseness5/5

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

The description is a single, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which likely covers return values), the description's minimalism is less problematic. However, for a mutation tool with 2 parameters, 0% schema coverage, and no annotations, the description should do more to explain behavior and parameter meaning. It's borderline adequate but leaves significant gaps in understanding.

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

Parameters2/5

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

Schema description coverage is 0%, so parameters are undocumented in the schema. The description mentions 'item' and 'collections' but doesn't explain what 'item_key' and 'collection_keys' represent (e.g., identifiers, formats), their constraints, or examples. It adds minimal semantic value beyond naming the entities involved.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add') and the target resource ('Zotero item to one or more collections'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from sibling tools like 'remove_from_collection' or 'update_item' that might also involve collection-item relationships.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., that the item and collections must already exist), exclusions, or how it differs from tools like 'create_item' (which might add to collections during creation) or 'update_item' (which might modify collection membership).

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

Install Server

Other Tools

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

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