Replace a Zotero note with Markdown
zotero_replace_noteReplace an existing Zotero note's entire content with Markdown while preserving its key, parent item, tags, and collections; the old HTML is returned for restoration.
Instructions
Replace the whole content of an existing Zotero note with new Markdown. The note keeps its key, parent item, tags and collections; only its text changes, and the old text is gone from Zotero (Zotero keeps no history of a note). The result returns the previous HTML as previousNote so it can be put back. Markdown: headings, paragraphs, bullet and numbered lists, bold, italic, strikethrough, code and fenced code blocks, links, > blockquotes, tables, horizontal rules, and $inline$ or $$display$$ math, all stored as the note editor's own HTML. Raw HTML is shown as text, not interpreted. Cite a library item with its key in brackets: [@ABCD2345], [@ABCD2345, p. 12], [see @ABCD2345; @WXYZ6789, pp. 3-5]. Each becomes a real Zotero citation (clickable in Zotero, live when the note is added to a Word document), and a key that names nothing refuses the write. Pass version (from zotero_get_item) to write only if nobody changed the note since you read it; without it the current text is replaced whatever it is. To add to a note instead, use zotero_append_to_note. Writes go to the running Zotero desktop app (Zotero 10+) for every library it holds, otherwise to the cloud Web API.
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": {
"note_key": "<note_key>",
"markdown": "<markdown>"
},
"name": "zotero_replace_note"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cite | No | Turn [@ITEMKEY] references into Zotero citations (default true). false leaves them as plain text. | |
| title | No | A heading placed at the top of the note, which Zotero then shows as its title. | |
| version | No | The note version you read. When given, a note that changed since is refused instead of overwritten. | |
| markdown | Yes | The note's new content, in Markdown. Everything the note held before is replaced. | |
| note_key | Yes | Key of the note to replace. | |
| library_id | No | Numeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id. | |
| library_type | No | Which library to address: "user" (a personal library) or "group" (a shared group library). Omit to use the library this server is configured for. "group" on its own is refused: pass library_id with it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Where the write went: "local" (Zotero desktop local API), "desktop" (connector protocol) or "cloud" (Zotero Web API). | |
| retried | No | True when a version conflict made it re-read the note before replacing it. | |
| note_key | Yes | The note this call replaced. | |
| citations | Yes | How many [@KEY] groups became Zotero citations. | |
| newVersion | Yes | The note's version after the write. | |
| previousNote | Yes | The note's HTML before this write, to restore it with zotero_update_item ({"note": ...}) if needed. |