Audit tags against a controlled vocabulary
zotero_tag_auditAudit a Zotero library against a controlled tag vocabulary, reporting off-vocabulary tags and items lacking required-tier tags. Optionally check coverage per collection.
Instructions
Audit a library against a controlled tag vocabulary with priority tiers. Provide the vocabulary inline as vocabulary (or a JSON file via vocabulary_path): { tags:[{name,tier?}], tiers?:[{name,required?}] }. Reports (1) off-taxonomy tags (library tags not in the vocabulary; Zotero auto-applied tags are bucketed separately unless include_auto), (2) items missing a tag from each required tier, and (3) optional per-collection coverage when scope.collection_keys is given. A key that none of these objects knows is refused and named, never dropped: a dropped scope, tier or required would change the question without changing the answer. Read-only. Tag and item enumeration both follow the library route, so a running Zotero desktop app serves the whole audit with no cloud API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max items listed per report (default 50). | |
| scope | No | Per-collection coverage: `{ collection_keys: [...] }`. A key this tool does not know is refused, never ignored. | |
| 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. | |
| vocabulary | No | The controlled vocabulary, inline: { tags: [{name, tier?}], tiers?: [{name, required?}] }. Use `vocabulary_path` instead to read it from a JSON file; passing both is refused. | |
| include_auto | No | Treat Zotero auto-applied tags as off-taxonomy too. | |
| 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. | |
| vocabulary_path | No | Path to a JSON file with the vocabulary. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autoTags | Yes | Zotero auto-applied tags, bucketed apart unless include_auto was set. | |
| collections | No | Per-collection coverage; present only when scope.collection_keys was given. | |
| offTaxonomy | Yes | Library tags the vocabulary does not list, capped at `limit`. | |
| itemsScanned | Yes | Top-level items audited (notes and attachments are skipped). | |
| autoTagsTotal | Yes | How many of those there are in total. | |
| missingByTier | Yes | Per required tier, the items carrying no tag from it. | |
| offTaxonomyTotal | Yes | How many there are in total. |