Skip to main content
Glama

Format a bibliography (citeproc / any CSL style)

zotero_format_bibliography
Read-only

Create formatted bibliographies in any CSL style from CSL-JSON items or Zotero library keys. Output HTML, text, or RTF without writing to your library.

Instructions

Render a formatted bibliography in any CSL style using citeproc-js — no Zotero library write required. Provide either items (an array of CSL-JSON objects, e.g. from zotero_import or external metadata) or item_keys (library items, which are exported to CSL-JSON first). Choose style (a name like "APA 7th" or a CSL id; default "apa"), locale (default "en-US"), and format (html/text/rtf; default html). The formatted bibliography text is returned. Use this for arbitrary items or styles; for items already in the library you can also use zotero_bibliography (server-rendered).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsNoCSL-JSON items to format.
styleNoStyle name or CSL id (default "apa").
formatNoOutput format (default html).
localeNoLocale (default "en-US").
item_keysNoLibrary item keys (exported to CSL-JSON).
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

TableJSON Schema
NameRequiredDescriptionDefault
entriesYesThe rendered entries, one string each, in bibliography order.
styleIdYesThe CSL style id actually used, e.g. "apa".
entryCountYesEntries citeproc rendered.
bibliographyYesThose entries joined: the ready-to-use bibliography, in the requested format.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.21.0
    • addedInput schema / properties / library_id / exclusiveMinimum
      Added value: +0
  2. Changed2 schema fields changedv1.20.2
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  3. Changed3 schema fields changedv1.20.0
    • addedInput schema / properties / library_id / description
      Added value: +"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."
    • addedInput schema / properties / library_type / description
      Added value: +"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."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "bibliography": {
      +      "description": "Those entries joined: the ready-to-use bibliography, in the requested format.",
      +      "type": "string"
      +    },
      +    "entries": {
      +      "description": "The rendered entries, one string each, in bibliography order.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "entryCount": {
      +      "description": "Entries citeproc rendered.",
      +      "type": "number"
      +    },
      +    "styleId": {
      +      "description": "The CSL style id actually used, e.g. \"apa\".",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "styleId",
      +    "entryCount",
      +    "entries",
      +    "bibliography"
      +  ],
      +  "type": "object"
      +}
  4. First observedv1.0.4

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false; the description reinforces this with 'no Zotero library write required' and clarifies the output ('The formatted bibliography text is returned'). This adds useful behavioral context beyond the annotations, though it does not go into edge cases or limitations.

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

Conciseness5/5

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

The description is information-dense but not bloated: it front-loads the core purpose and no-write guarantee, then compactly covers input alternatives, optional parameters, defaults, output, and sibling differentiation. Every sentence contributes useful decision-making information.

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 7-parameter tool, the description covers the critical decision of which input to provide, explains defaults and output format, and names the relevant sibling alternative. With an output schema present and full schema parameter documentation, nothing essential 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 description coverage is 100%, so the baseline is 3. The description adds value by explaining the relationship between `items` and `item_keys`, noting that `item_keys` are 'exported to CSL-JSON first', and clarifying that `style` accepts either a name or a CSL id. This goes beyond the schema's individual parameter descriptions.

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?

The description states a specific action and resource: 'Render a formatted bibliography in any CSL style using citeproc-js'. It also distinguishes itself from zotero_bibliography by emphasizing arbitrary items or styles versus server-rendered library items, making sibling differentiation explicit.

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?

The description explicitly says when to use this tool: 'Use this for arbitrary items or styles' and names the alternative, 'for items already in the library you can also use zotero_bibliography'. It also explains the either/or input choice between `items` and `item_keys`, giving direct usage direction.

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