Skip to main content
Glama

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:

  1. Collect item keys: use add_items_by_doi (or search_library for existing items)

  2. 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.

  3. Call this tool with the .docx file path. It replaces every zcite tag with a Zotero field code and appends a bibliography.

  4. 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

TableJSON Schema
NameRequiredDescriptionDefault
styleNoCitation style for the visible placeholder text. Zotero will reformat on refresh. Default: apaapa
file_pathYesAbsolute path to the .docx file containing <zcite keys="..."/> placeholder tags
Behavior5/5

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

With no annotations provided, the description takes full responsibility for behavioral disclosure. It states the tool fetches metadata automatically, replaces tags, appends a bibliography, outputs a new file with '_cited' suffix, requires Word/Zotero refresh, and warns about num attribute requirements for numbered styles. This is thorough and non-misleading.

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 long but extremely well-structured with clear headers (WORKFLOW, CITATION STYLES, ZCITE TAG FORMAT, OUTPUT, NOTE). Every section serves a distinct purpose, and the core purpose is front-loaded. No filler or redundancy.

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?

Given the tool's complexity (two parameters, multi-step workflow, style-specific constraints, and no output schema), the description covers all essential context: prerequisites, step-by-step instructions, tag syntax with examples, output format, and fallback guidance. The agent has everything needed to invoke and execute this tool correctly.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds crucial meaning: it explains style-dependent behavior (apa vs numbered styles), the required num attribute, and the exact meaning of file_path in the workflow. It also documents the full zcite tag format with attribute details, far exceeding the schema's brief parameter descriptions.

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?

The description opens with a specific verb+resource statement: 'Replace <zcite> placeholder tags in a .docx file with native Zotero field codes.' This clearly distinguishes the tool from siblings like add_items_by_doi or import_pdf_to_zotero, as it focuses purely on citation injection into a Word document.

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?

The description provides an explicit WORKFLOW section that sequences this tool after item-key collection and .docx generation, plus a final NOTE saying to prefer the skill workflow when available and that this tool is the primary path otherwise. It also instructs to ask the user for citation style before generating, covering when-to-use and alternatives.

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

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