Skip to main content
Glama

Replace a Zotero note with Markdown

zotero_replace_note
DestructiveIdempotent

Replace 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

NameRequiredDescriptionDefault
citeNoTurn [@ITEMKEY] references into Zotero citations (default true). false leaves them as plain text.
titleNoA heading placed at the top of the note, which Zotero then shows as its title.
versionNoThe note version you read. When given, a note that changed since is refused instead of overwritten.
markdownYesThe note's new content, in Markdown. Everything the note held before is replaced.
note_keyYesKey of the note to replace.
library_idNoNumeric 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_typeNoWhich 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

NameRequiredDescriptionDefault
targetNoWhere the write went: "local" (Zotero desktop local API), "desktop" (connector protocol) or "cloud" (Zotero Web API).
retriedNoTrue when a version conflict made it re-read the note before replacing it.
note_keyYesThe note this call replaced.
citationsYesHow many [@KEY] groups became Zotero citations.
newVersionYesThe note's version after the write.
previousNoteYesThe note's HTML before this write, to restore it with zotero_update_item ({"note": ...}) if needed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.23.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the description's job is to add context, which it does: the note keeps key, parent, tags and collections; the old text is gone and Zotero keeps no history; the previous HTML is returned as `previousNote` so it can be restored. It also discloses that a citation key naming nothing refuses the write and that writes go to the desktop app when running, else the cloud Web API. It stops short of stating permission/auth requirements, which keeps it off a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the destructive replace and the append alternative before the syntax detail. The long Markdown feature enumeration is the bulkiest section, but each item defines what will actually parse, so it earns its place; a slightly tighter list would read better.

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?

For a destructive write tool with 7 params, an output schema and full annotation coverage, the description covers the mutation's side effects, the rollback path, concurrency, citation resolution failure, and backend routing. Nothing an agent needs to call it safely 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 the baseline is 3, but the description adds real meaning beyond the schema: it explains the exact `version` optimistic-concurrency semantics (refused vs. blind overwrite), documents the [@KEY], [@KEY, p. 12] and multi-key citation syntax that `markdown`/`cite` accept, and notes that raw HTML is treated as text. That is more than the schema fields say.

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?

Opens with a specific verb and resource plus scope: 'Replace the whole content of an existing Zotero note with new Markdown.' It also names the sibling it is not (zotero_append_to_note) and distinguishes replace from append in the first and last sentences, so an agent can route correctly without opening either schema.

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?

Explicitly routes the alternative case: 'To add to a note instead, use zotero_append_to_note.' It also states the condition for the concurrency option ('Pass `version` ... to write only if nobody changed the note since you read it; without it the current text is replaced whatever it is') and when to set cite=false. When-to-use and when-not-to-use are both covered.

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