Skip to main content
Glama
54yyyu
by 54yyyu

Zotero Create Annotation

zotero_create_annotation

Add highlights, area boxes, or sticky notes to PDF/EPUB attachments in your Zotero library. Specify the attachment key, page, and one mode—text, rect, or note—to annotate specific content.

Instructions

Create an annotation on a PDF attachment (EPUB: highlights only). Exactly one mode per call: text= HIGHLIGHTS selectable text; rect= draws an AREA box over a figure, table, or other non-text region (PDF only); note=[x, y] places a STICKY NOTE centered on that normalized point, its text in comment (PDF only). Passing several or none is an error. attachment_key: the PDF/EPUB attachment key, NOT the parent item key (zotero_get_item_children finds it). page: 1-indexed page (EPUB: 1-indexed chapter). text: exact text to highlight, matched against the text layer — scanned/image-only PDFs will not match. rect: [x, y, width, height] normalized to [0, 1], with (0, 0) at the page's top-left; width/height are page-relative and the box must fit the page. Call zotero_get_page_layout first and reuse a detected region's bbox instead of guessing coordinates. comment, color (hex, default '#ffd400'), tags: optional. Requires PyMuPDF (the [pdf] extra) and a writable library: local writes (Zotero 10+) or a web API key. Examples: (attachment_key='NHZFE5A7', page=4, text='working memory'); (attachment_key='NHZFE5A7', page=7, rect=[0.15, 0.22, 0.6, 0.35], comment='Figure 3').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNo
pageYes
rectNo
tagsNo
textNo
colorNo#ffd400
commentNo
attachment_keyYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.13.1
    • addedInput schema / properties / note
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed1 schema field changedv0.11.0
    • changedInput schema / properties / rect / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "type": "number"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "type": "number"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  3. Changed10 schema fields changedv0.9.0
    • removedInput schema / properties / attachment_key / description
      Removed value: -"Attachment key (e.g., \"NHZFE5A7\")"
    • removedInput schema / properties / color / description
      Removed value: -"Highlight color in hex format (default: \"#ffd400\" yellow)"
    • removedInput schema / properties / comment / description
      Removed value: -"Optional comment on the annotation"
    • removedInput schema / properties / page / description
      Removed value: -"For PDF: 1-indexed page number. For EPUB: 1-indexed chapter number."
    • addedInput schema / properties / rect
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / text / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / text / default
      Added value: +null
    • removedInput schema / properties / text / description
      Removed value: -"Exact text to highlight (used to find coordinates/CFI)"
    • removedInput schema / properties / text / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "attachment_key",
      -  "page",
      -  "text"
      -]New value: +[
      +  "attachment_key",
      +  "page"
      +]
  4. Addedv0.4.1

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and succeeds: it states the PyMuPDF dependency (the [pdf] extra), the writable-library requirement (local writes Zotero 10+ or web API key), the scanned/image-only PDF text-matching limitation, the EPUB highlights-only constraint, and the rect-must-fit-page rule. For a mutation tool with zero annotation coverage this is comprehensive and honest.

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?

The description is long, but length is justified by 8 parameters with 0% schema coverage and a three-mode API. It is front-loaded with the core purpose and mode distinction, and the trailing examples clarify exact argument formats. Minor redundancy exists between the parameter prose and the examples, which could have been trimmed, so it falls just short of a 5.

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?

Given the tool's complexity (3 modes, EPUB/PDF differences, normalized coordinates, prerequisites) the description is essentially complete. The output schema already covers return values, so no return-format prose is needed. Missing items are negligible: the description covers prerequisites, error conditions, coordinate conventions, limitations, and provides concrete examples.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must fully compensate, and it does: it explains attachment_key is the attachment key NOT the parent item key, page is 1-indexed (chapter for EPUB), text matches the text layer exactly, rect is normalized [x,y,width,height] with (0,0) at top-left and page-relative dims, note is a normalized [x,y] point with text in comment, plus color default and tags. Every one of the 8 parameters is semantically covered in prose.

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 opens with a specific verb-resource pair ('Create an annotation on a PDF attachment') and immediately distinguishes three mutually exclusive modes (text, rect, note) with clear semantics for each. It differentiates cleanly from siblings like zotero_get_annotations (read), zotero_update_annotation (modify), and zotero_delete_annotation (delete), so an agent can select this tool unambiguously.

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 routes to sibling tools for correct usage: it names zotero_get_item_children for finding the attachment key and instructs the agent to call zotero_get_page_layout first and reuse a detected bbox instead of guessing coordinates. It also spells out the error condition ('Passing several or none is an error') and the EPUB-vs-PDF applicability split, giving the agent clear when/how guidance.

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