Skip to main content
Glama

create_cited_document

Create a new Word or LibreOffice document from Markdown with native Zotero citations and a bibliography, then refresh it in the Zotero plugin. Fetches item metadata and never overwrites existing files.

Instructions

Create a Word (.docx) or LibreOffice (.odt) document from Markdown with native Zotero citations and a bibliography, ready for the Zotero plugin's Refresh. Unlike inject_citations (which fills placeholders in an existing file), this writes a new document from Markdown text.

WORKFLOW:

  1. Collect item keys with add_items_by_doi, add_items or search_library.

  2. Write the body as Markdown, with pandoc-style citations where they belong.

  3. Call this tool with the Markdown and an output path. It fetches metadata from Zotero, renders the document and appends the bibliography. It never overwrites an existing file.

  4. Tell the user to open it in Word or LibreOffice with the Zotero plugin → Add/Edit Bibliography, then Refresh.

MARKDOWN SUBSET: headings (#…), paragraphs, bold (…), italic (…), one-level bullet lists (-). Anything else is kept as text, with a warning.

CITATIONS (pandoc style): [@KEY] one item; [@KEY1; @KEY2] several; [see @KEY, p. 12] with prefix and locator; -@KEY to suppress the author. KEY is a Zotero item key. For IEEE/Vancouver the numbers follow the order of first citation automatically.

OUTPUT: a new .docx or .odt (format from the extension, or the format argument). A cited key that is not in the library, or is not a Zotero key, is an error and nothing is written. If the output file already exists it is an error (never overwritten).

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": {
      "markdown": "<markdown>",
      "output_path": "<output_path>"
    },
    "name": "create_cited_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
styleNoCitation style for the visible placeholder text. Zotero reformats on refresh. Default: apaapa
formatNodocx for Word, odt for LibreOffice. Defaults to the output extension; an error if it disagrees.
markdownYesThe document body as Markdown, with pandoc-style citations like [@ITEMKEY].
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.
output_pathYesAbsolute path of the .docx or .odt file to create. Must not already exist.
library_typeNoLibrary for this call: 'user' (personal) or 'group'. Default: the library configured on the server.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.0

TDQS

A4.9/5.0
Behavior5/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 so: it discloses that existing files are never overwritten, that an unknown or invalid key is an error with nothing written, that format is inferred from the extension and disagreements are errors, and that metadata is fetched from Zotero and a bibliography appended. It also documents the supported Markdown subset and how unsupported syntax degrades to text with a warning.

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 opening sentence gives purpose and sibling contrast, then labeled sections (WORKFLOW, MARKDOWN SUBSET, CITATIONS, OUTPUT) make it scannable. Length is justified by the number of distinct behaviors an agent must get right on a write operation.

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?

A six-parameter mutation tool with no annotations and no output schema, yet the description covers inputs, failure modes, format resolution, and the resulting artifact plus the manual step the user must perform. Nothing needed to call it correctly is missing.

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, but the description adds real meaning: pandoc-style citation syntax for the markdown parameter, the extension/format precedence rule, and the note that style only affects visible placeholder text because Zotero reformats on refresh. library_id/library_type behavior is left to the schema, which already documents it.

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 (create) plus the resource (a .docx/.odt document) and its distinguishing input (Markdown with native Zotero citations + bibliography). It explicitly separates itself from inject_citations by explaining that tool fills placeholders in an existing file while this one writes a new 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?

Provides a numbered workflow covering prerequisite item collection (add_items_by_doi, add_items, search_library), authoring step, invocation, and the required user follow-up (open in Word/LibreOffice, Add/Edit Bibliography, Refresh). The alternative tool is named together with the condition that selects it.

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