Skip to main content
Glama

Create Annotation

create_annotation

Highlight quoted text in a Zotero PDF, using fuzzy matching to handle OCR errors and avoid duplicate highlights by appending comments or using contrasting colors.

Instructions

Highlight a text passage in a PDF attached to a Zotero item.

Searches the PDF for the quoted text and creates a visible highlight annotation in Zotero's PDF reader. Uses three strategies in order: exact match, normalized word match, and fuzzy match (for OCR errors, hyphenation differences, or minor transcription mismatches).

Smart overlap handling:

  • If the same text is already highlighted, appends the new comment to the existing annotation instead of creating a duplicate.

  • If the new text is a sub-passage of an existing highlight (or vice versa), the new highlight is created in a contrasting color so both are visually distinct.

Args: item_key: The Zotero item key (the parent item, not the attachment) quoted_text: The text passage to highlight in the PDF (fuzzy matching handles minor differences from the actual PDF text) comment: Optional comment to attach to the highlight color: Highlight color as hex (default "#ffd400" yellow) max_l_dist: Maximum Levenshtein distance for fuzzy matching. Default is ~20% of the search text length. Increase if the PDF has many OCR errors; decrease for stricter matching. attachment_key: Optional PDF attachment key when the item has multiple PDFs page_number: Optional one-based page number to search occurrence: One-based occurrence to highlight when text repeats

Pass both library_id and library_type to target another library; omit both to use the configured default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colorNo#ffd400
commentNo
item_keyYes
library_idNo
max_l_distNo
occurrenceNo
page_numberNo
quoted_textYes
library_typeNo
attachment_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.0
    • addedInput schema / properties / library_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Library Id"
      +}
    • addedInput schema / properties / library_type
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "user",
      +        "group"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Library Type"
      +}
  2. First observedv0.9.0

TDQS

A4.7/5.0
Behavior5/5

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

The description adds substantial behavioral context beyond the annotations: it explains the three matching strategies (exact, normalized, fuzzy), duplicate avoidance, sub-passage overlap handling by using contrasting colors, and the effect of appending comments. It also aligns with the readOnlyHint=false and destructiveHint=false annotations.

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 appropriately sized for a 10-parameter tool. It front-loads the purpose, then presents behavior and parameters in clearly structured sections, with every sentence adding useful information and no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the tool's purpose, matching behavior, overlap rules, and all parameter semantics thoroughly. It does not mention failure modes such as what happens when the quoted text is not found or when only one of library_id/library_type is provided, but these are minor gaps given the rich context already provided.

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 carries the full parameter burden. Its Args section explains all parameters meaningfully, including the parent item key vs attachment, Levenshtein distance guidance, one-based page and occurrence semantics, and the library_id/library_type pairing rule.

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 and resource: 'Highlight a text passage in a PDF attached to a Zotero item.' This clearly identifies the tool as a creation operation using quoted text, and the detailed behavior distinguishes it from sibling tools like get_annotations, update_annotation, and delete_annotation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool, including search strategies, overlap handling, and library targeting. It does not explicitly name alternatives or state when-not-to-use it, so it stops short of a full 5.

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