inject_citations
Replace placeholder tags in a .docx with native Zotero field codes so Word citations stay live and manageable, appending a bibliography automatically.
Instructions
Replace placeholder tags in a .docx file with native Zotero field codes that Zotero for Word can recognize and manage. The tool fetches item metadata from Zotero automatically — you only need to provide the .docx file.
WORKFLOW — how to create a Word document with live Zotero citations:
Collect item keys: use add_items_by_doi or add_items (or search_library for existing items)
Generate .docx: create a Word document (e.g. with the "docx" npm package) with placeholders where citations should appear. Each MUST be in its own dedicated TextRun — do NOT mix it with surrounding text.
Call this tool with the .docx file path. It replaces every zcite tag with a Zotero field code and appends a bibliography.
Tell the user to open the file in Word with the Zotero plugin, click Zotero → Add/Edit Bibliography, then Zotero → Refresh.
CITATION STYLES — ask the user which style they want before generating:
apa (default): author-year — (Smith, 2023)
harvard / chicago: author-date — (Smith, 2023) / (Smith 2023)
ieee / vancouver: numbered — [1], [2] WARNING: for numbered styles every MUST include a num="N" attribute with the sequential citation number. Without num, citations render as [?].
ZCITE TAG FORMAT: Supported attributes (any order):
keys (required): item key or comma-separated keys — "ABC12345" or "ABC12345,DEF67890"
num: citation number for IEEE/Vancouver — "1" or "1,2" (required for numbered styles)
locator: page reference — "12-15" (shown as "pp. 12–15"; other labels explicit, e.g. "chap. 3")
prefix: text before citation — "see"
suffix: text after citation — ", emphasis added"
OUTPUT: A new .docx file (original filename with _cited suffix) with Zotero field codes and a ZOTERO_BIBL bibliography at the end. A cited key that is not in the library, or that is not a Zotero key (8 characters from 23456789ABCDEFGHIJKLMNPQRSTUVWXYZ), is an error and no file is written.
WHERE THE FILE LIVES: this tool reads and writes files on the machine where this MCP server runs. If you create the .docx in a sandbox or cloud workspace that the server cannot see (for example code execution in Claude.ai or Claude Desktop, paths like /mnt/user-data/...), do not call this tool: use the zotero-mcp-integrations skill, which injects the citations inside the sandbox with metadata from get_items_details. If that skill is not installed, recommend it to the user: zotero-skill-mcp-integrations.zip from https://github.com/Xevos117/mcp-zotero/releases/latest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | Citation style for the visible placeholder text. Zotero will reformat on refresh. Default: apa | apa |
| file_path | Yes | Absolute path to the .docx file containing <zcite keys="..."/> placeholder tags | |
| library_id | No | 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. | |
| library_type | No | Library for this call: 'user' (personal) or 'group'. Default: the library configured on the server. |