Skip to main content
Glama

Create Annotation

create_annotation

Highlights a text passage in a PDF attached to a Zotero item by matching the quoted text, using fuzzy search for OCR errors and avoiding duplicate highlights.

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

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description goes beyond the readOnlyHint=false and destructiveHint=false annotations by disclosing internal behaviors: fuzzy matching strategies, duplicate avoidance (appending comments), and contrasting color for sub-passages. It clearly indicates that existing annotations may be modified, which is valuable context. No contradiction with 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 well-structured with a clear opening statement, bullet points for matching strategies and overlap handling, and a detailed Args list. Every sentence adds value, and the layout makes it easy to scan. It is appropriately sized for a complex tool.

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 an 8-parameter creation tool with complex matching behavior, the description covers everything an agent needs: parameter semantics, default values, search strategies, and deduplication/overlap handling. An output schema exists, so return values need not be described. This is a complete and self-sufficient description.

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%, but the description's Args section thoroughly explains all 8 parameters, including details like item_key being the parent item not the attachment, the meaning of max_l_dist (Levenshtein distance with default ~20%), and the semantics of occurrence and page_number. This fully compensates for the sparse schema.

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 clearly states that the tool highlights a text passage in a PDF attached to a Zotero item, creating a visible annotation. This specific verb+resource combination distinguishes it from sibling tools like update_annotation, delete_annotation, and get_annotations.

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 this tool: to create highlights based on quoted text, with strategies for fuzzy matching and overlap handling. It does not explicitly name alternatives, but the usage scenario is obvious from the detailed behavior, so it earns a 4 rather than a 3.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RaulSimpetru/zotero-library-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server