Word References and Notes
word_referencesInsert and manage Word tables of contents, figure/table lists, footnotes, endnotes, captions, bookmarks, cross-references, index entries, citations, and bibliographies in .docx files.
Instructions
Generated lists and scholarly apparatus: TOC and lists of figures and tables, footnotes and endnotes, captions, bookmarks, cross-references, index, citations, bibliography and Zotero. Plain text is word_edit. Every edit backs the file up first and saves atomically, and these ops refuse a document open in Word. Field results (TOC entries, page numbers, Word citations) fill in when Word updates fields, for example through word_app com_refresh_fields. Ops, one per line, as name(required; opt optional): what it does. file_path, live and backup are not repeated; word_help shows them:
manage_note(action; opt note_type text location note_id position): Insert, edit or delete a footnote or endnote, or remove orphaned note definitions (action).
insert_caption(text; opt table_index after_text image_id label above): Insert a numbered caption (SEQ field), 'Table N: text', above a table or below an image (image_id from list_elements; above flips either), or after the paragraph holding after_text.
insert_reference_list(type; opt title location options update_on_open): Insert a generated list (type): bibliography, TOC, list of figures, tables or equations, index, or glossary.
insert_bookmark(name, at_text; opt occurrence): Bookmark a text range by name, for cross-references, hyperlinks and the {bookmark: name} location; duplicate names are refused.
convert_notes(direction; opt note_id position): Convert footnotes to endnotes or back.
insert_cross_reference(to_bookmark, location; opt kind): Insert a cross-reference field pointing at a bookmark (create targets with insert_bookmark).
mark_index_entry(entry, location; opt subentry bold_page italic_page see): Mark an index entry with a hidden XE field at a location; insert_reference_list type='index' compiles the index. More ops follow, in the same format, in the op parameter's description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The operation to run: an op listed in this tool's description, or one of these, in the same format: - insert_citation(tag, location; opt pages suppress_author suppress_year prefix suffix): Insert a CITATION field for a stored source (tag from manage_source) at a location; it shows a placeholder until fields update. - insert_zotero_citation(item_keys, location; opt page prefix suffix db_path): Insert a REAL Zotero citation field (ADDIN ZOTERO_ITEM CSL_CITATION) at a location object position; Zotero recognizes and refreshes it. - search_zotero_library(query; opt db_path limit): Search the user's LOCAL Zotero library (read-only; the database is never modified). - manage_source(action, tag; opt source_type title year authors editors journal_name book_title publisher city pages volume issue edition institution url internet_site_title style extra_fields force): Add or delete a Word bibliography source by tag (action); deleting a cited source is refused unless force=true. - set_bibliography_style(style): Set the style Word's own citation and bibliography fields render in (APA, Chicago, MLA, IEEE, Turabian and others). - convert_citation_style(target_style; opt source_style dry_run): Convert plain-text citations and the reference list to another style; anything not fully parsed is left as is and flagged. | |
| args | No | The op's arguments as an object. Include file_path (the absolute .docx path) unless the op's line names other paths or the op reads no document; unknown keys are refused. word_help lists every argument. |