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:
Collect item keys with add_items_by_doi, add_items or search_library.
Write the body as Markdown, with pandoc-style citations where they belong.
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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | Citation style for the visible placeholder text. Zotero reformats on refresh. Default: apa | apa |
| format | No | docx for Word, odt for LibreOffice. Defaults to the output extension; an error if it disagrees. | |
| markdown | Yes | The document body as Markdown, with pandoc-style citations like [@ITEMKEY]. | |
| 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. | |
| output_path | Yes | Absolute path of the .docx or .odt file to create. Must not already exist. | |
| library_type | No | Library for this call: 'user' (personal) or 'group'. Default: the library configured on the server. |