Expand description
BBT (Better BibTeX) citekey database reader.
§What this does
Better BibTeX assigns citation keys to Zotero items. These keys (like “demilloHintsTestData1978”) are the primary way users reference items in the MCP tools. We need to map them to Zotero’s internal 8-char item keys (like “9MS26VH5”).
§The better-bibtex.migrated file
BBT stores its citekey assignments in ~/Zotero/better-bibtex.migrated,
a SQLite database with a citationkey table:
CREATE TABLE citationkey (
itemID INTEGER,
itemKey TEXT,
libraryID INTEGER,
citationKey TEXT,
pinned INTEGER
);This is much faster than calling BBT’s JSON-RPC API (~0.01ms vs ~300ms).
Structs§
- BbtDb
- Read-only connection to the BBT citekey database.
Functions§
- all_
citekeys_ from_ zotero_ sqlite - Load all citekeys from
zotero.sqlite(most complete source). - citekey_
from_ zotero_ sqlite - Read citekeys directly from
zotero.sqlite(field name = “citationKey”). - item_
key_ from_ zotero_ sqlite - Reverse lookup: find item key by citekey in
zotero.sqlite.