Skip to main content
Glama

Link items as Related

zotero_relate_items
Idempotent

Link pairs of Zotero library items as Related on both items, preserving existing relations and validating all keys before writing.

Instructions

Link pairs of library items as "Related", the link Zotero shows in an item's Related pane, on BOTH items of each pair, as Zotero itself does. Additive only: every relation an item already has (other Related links, merge records, any other predicate) is kept, and a pair already linked is reported as such and not written again. Both items must be in the same library. Every item is read before anything is written, so an unknown key refuses the whole call. Get candidates from zotero_suggest_related (pairs that cite each other), or pass any pairs you choose. To remove a link, edit relations with zotero_update_item. Writes go to the running Zotero desktop app (Zotero 10+) for every library it holds, otherwise to the cloud Web API. A personal library that has never synced to a zotero.org account cannot be linked from here: Zotero names it in the link by a local id neither API exposes.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pairs": "<pairs>"
    },
    "name": "zotero_relate_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairsYesPairs to link, at most 100. Order inside a pair does not matter; both items get the link.
library_idNoNumeric 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_typeNoWhich 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

NameRequiredDescriptionDefault
itemsYesOne entry per distinct item.
failedYesItems that failed.
linkedYesItems whose relations were written.
targetNoWhere the write went: "local" (Zotero desktop local API), "desktop" (connector protocol) or "cloud" (Zotero Web API).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.25.1

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations: additive-only semantics, existing relations preserved, already-linked pairs reported rather than rewritten, full pre-read validation so an unknown key aborts the entire call, and a stated backend routing rule (desktop app for Zotero 10+ vs cloud Web API). These are precisely the behaviors an agent can't infer from readOnlyHint=false, idempotentHint=true, or destructiveHint=false.

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

Conciseness4/5

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

Front-loaded with the action and the additive guarantee, then alternatives, then the environment caveat. Dense and mostly waste-free, though the closing sentence about local ids is long and slightly speculative detail for an agent that just needs to know the call will fail.

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

Completeness5/5

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

An output schema exists, so return values need not be described, and everything else an agent needs is present: atomic validation, idempotency behavior, library scoping, removal path, and backend determination. Nothing material is missing for a 3-parameter bulk-link tool.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3; the description nevertheless adds real meaning by clarifying that order inside a pair is irrelevant and both items receive the link, and by tying the same-library constraint to the parameters. It does not add syntax or format detail beyond the schema, which is fine given full coverage.

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

Purpose5/5

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

States a specific verb and resource ('Link pairs of library items as Related') and pins down the exact scope: the Related pane link, applied to BOTH items of each pair, mirroring Zotero's own behavior. This is clearly distinguishable from generic mutation siblings like zotero_update_item.

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

Usage Guidelines5/5

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

Explicitly routes candidates to zotero_suggest_related, allows arbitrary pairs, and names zotero_update_item with the `relations` field as the way to remove a link. It also states the when-not condition: both items must share a library, and a never-synced personal library cannot be linked.

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