Skip to main content
Glama

add_items_by_doi

Resolve DOIs and add the matching items to a Zotero library with automatic metadata, correct item types, and optional open-access PDF attachment.

Instructions

Add items to your Zotero library by resolving DOIs. Works with ANY item type that has a DOI — journal articles, books, datasets, preprints, conference papers, reports, etc. For each DOI, resolves metadata via content negotiation and creates the item in Zotero with the correct type automatically. Returns a list of successfully added items (with item_key and title) and any failures.

WHEN TO USE vs add_items:

  • Use add_items_by_doi when the item HAS a DOI — it auto-resolves all metadata and attaches open-access PDFs (when the server has UNPAYWALL_EMAIL set).

  • Use add_items when the item does NOT have a DOI, or when you need to override specific metadata fields (add_items_by_doi does not allow metadata overrides).

  • Mixed batch: if some items have DOIs and others don't, make two separate calls — add_items_by_doi for the DOIs and add_items for the rest.

WORKFLOW TIPS:

  • To collect metadata for all added items, call get_items_details with the returned item_keys (single batch call).

  • To create a cited Word document, use the returned item_keys as placeholders in a .docx, then call inject_citations. See inject_citations description for the full workflow.

Input Schema

NameRequiredDescriptionDefault
doisYesArray of bare DOIs (e.g. ["10.1038/s41586-023-06647-8"], without "https://doi.org/"). Each DOI will be resolved and added to Zotero.
tagsNoTags to apply to all added items
library_idNoNumeric user or group ID for this call (a group's ID is the number in its zotero.org/groups/<id> URL). Default: the configured library. Required with library_type 'group' when the server is configured for a user library.
library_typeNoLibrary for this call: 'user' (personal) or 'group'. Default: the library configured on the server.
collection_keyNoZotero collection key to add items to. Get this from create_collection or get_collections.
auto_attach_pdfNoAttach open-access PDFs found via Unpaywall (default: true; needs UNPAYWALL_EMAIL in the server settings, uses the user's Zotero file storage). Leave enabled unless the user does not want PDFs or attachment is causing errors.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.4
    • changedInput schema / properties / auto_attach_pdf / description
      Previous value: -"Attach freely available OA PDFs via Unpaywall (default: true). This is lightweight and adds no cost — leave enabled. Only set to false if PDF attachment is causing errors."New value: +"Attach open-access PDFs found via Unpaywall (default: true; needs UNPAYWALL_EMAIL in the server settings, uses the user's Zotero file storage). Leave enabled unless the user does not want PDFs or attachment is causing errors."
    • changedInput schema / properties / dois / description
      Previous value: -"Array of DOI strings (e.g. [\"10.1038/s41586-023-06647-8\"]). Each DOI will be resolved and added to Zotero."New value: +"Array of bare DOIs (e.g. [\"10.1038/s41586-023-06647-8\"], without \"https://doi.org/\"). Each DOI will be resolved and added to Zotero."
    • changedInput schema / properties / library_id / description
      Previous value: -"Override the configured library ID for this call. Defaults to ZOTERO_LIBRARY_ID env (or ZOTERO_USER_ID). Required when library_type is 'group' and the server is configured for a user library."New value: +"Numeric user or group ID for this call (a group's ID is the number in its zotero.org/groups/<id> URL). Default: the configured library. Required with library_type 'group' when the server is configured for a user library."
    • changedInput schema / properties / library_type / description
      Previous value: -"Override the configured Zotero library type for this call. Defaults to ZOTERO_LIBRARY_TYPE env (or 'user'). Use to target a different library per call without restarting the server."New value: +"Library for this call: 'user' (personal) or 'group'. Default: the library configured on the server."
  2. Changed4 schema fields changedv2.0.2
    • addedInput schema / properties / collection_key / pattern
      Added value: +"^[23456789ABCDEFGHIJKLMNPQRSTUVWXYZ]{8}$"
    • addedInput schema / properties / dois / items / minLength
      Added value: +1
    • addedInput schema / properties / library_id
      Added value: +{
      +  "description": "Override the configured library ID for this call. Defaults to ZOTERO_LIBRARY_ID env (or ZOTERO_USER_ID). Required when library_type is 'group' and the server is configured for a user library.",
      +  "pattern": "^\\d+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / library_type
      Added value: +{
      +  "description": "Override the configured Zotero library type for this call. Defaults to ZOTERO_LIBRARY_TYPE env (or 'user'). Use to target a different library per call without restarting the server.",
      +  "enum": [
      +    "user",
      +    "group"
      +  ],
      +  "type": "string"
      +}
  3. First observedv1.0.9

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it well: it discloses automatic metadata resolution via content negotiation, automatic item-type selection, PDF attachment side effects gated on UNPAYWALL_EMAIL and using the user's file storage, and that results are split into successes and failures. It stops short of stating permission/auth requirements or how duplicate DOIs already in the library are handled.

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?

Front-loaded with the primary purpose, then cleanly sectioned into WHEN TO USE vs add_items and WORKFLOW TIPS. Each block is scannable and every sentence conveys routing or workflow information.

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?

No output schema exists, but the description compensates by stating the return shape (item_key and title for successes, plus failures). Combined with sibling routing and the PDF side-effect disclosure, an agent has everything needed to call it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so all six parameters are already documented, establishing a baseline of 3. The description adds only marginal semantics beyond the schema (that DOIs must be bare, that PDF attachment depends on server config, and that no metadata overrides are possible), none of which redefines parameter behavior.

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+resource ("Add items to your Zotero library by resolving DOIs") and immediately clarifies scope: any item type with a DOI. It explicitly names and differentiates itself from the sibling add_items in a dedicated section, so an agent can disambiguate without opening either schema.

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?

Gives explicit when-to-use and when-not-to-use rules against add_items, including the mixed-batch case ("make two separate calls"). It also names concrete alternatives for downstream steps (get_items_details, inject_citations), leaving nothing to inference.

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