inject_citations
Replace placeholder tags in a .docx with Zotero field codes, automatically fetching item metadata and appending a bibliography for live, managed citations in Word.
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 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 and click Zotero → Refresh.
CITATION STYLES — ask the user which style they want before generating:
apa (default): author-year — (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 — "pp. 12-15"
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.
NOTE: If the inject-citations skill is available, prefer the skill workflow (runs in sandbox, no filesystem dependency). This tool serves as the primary path when the skill is not available.
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 |