Skip to main content
Glama

search_library

Search Zotero library items by title, creator, or year, or list them sorted by a chosen field. Use returned item keys to retrieve details, read full text, or inject citations.

Instructions

Search your Zotero library or list items sorted by a field.

When 'query' is provided, matches it against titles, creator names and years (not abstracts, tags or full text). When 'query' is omitted — or is empty / only whitespace — it is treated as no query: the tool lists items sorted by the chosen field (default: dateAdded, descending), up to 'limit'.

Examples:

  • Search: { "query": "deep learning" }

  • Recent items: { "sort": "dateAdded", "limit": 10 }

  • Recent with search: { "query": "transformers", "sort": "dateAdded", "limit": 5 }

Use the returned item keys with get_items_details, get_item_fulltext, or inject_citations.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_library"
  }
}

Input Schema

NameRequiredDescriptionDefault
sortNoField to sort by (default: dateAdded)dateAdded
limitNoMaximum number of items to return, 1-100 (default: 25; above 100 returns 100)
queryNoSearch query. If omitted, empty or only whitespace, returns items sorted by the chosen field.
directionNoSort direction (default: desc)desc
library_idNoNumeric user or group ID for this call (a group's ID is the number in its zotero.org/groups/<id> URL). Default: the configured library. Required with library_type 'group' when the server is configured for a user library.
library_typeNoLibrary for this call: 'user' (personal) or 'group'. Default: the library configured on the server.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.0
    • changedInput schema / properties / query / description
      Previous value: -"Search query. If omitted, returns items sorted by the chosen field."New value: +"Search query. If omitted, empty or only whitespace, returns items sorted by the chosen field."
  2. Changed6 schema fields changedv2.0.4
    • changedInput schema / properties / library_id / description
      Previous value: -"Override the configured library ID for this call. Defaults to ZOTERO_LIBRARY_ID env (or ZOTERO_USER_ID). Required when library_type is 'group' and the server is configured for a user library."New value: +"Numeric user or group ID for this call (a group's ID is the number in its zotero.org/groups/<id> URL). Default: the configured library. Required with library_type 'group' when the server is configured for a user library."
    • changedInput schema / properties / library_type / description
      Previous value: -"Override the configured Zotero library type for this call. Defaults to ZOTERO_LIBRARY_TYPE env (or 'user'). Use to target a different library per call without restarting the server."New value: +"Library for this call: 'user' (personal) or 'group'. Default: the library configured on the server."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of items to return (default: 25, max: 100)"New value: +"Maximum number of items to return, 1-100 (default: 25; above 100 returns 100)"
    • addedInput schema / properties / limit / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / limit / minimum
      Added value: +1
    • changedInput schema / properties / limit / type
      Previous value: -"number"New value: +"integer"
  3. Changed2 schema fields changedv2.0.2
    • addedInput schema / properties / library_id
      Added value: +{
      +  "description": "Override the configured library ID for this call. Defaults to ZOTERO_LIBRARY_ID env (or ZOTERO_USER_ID). Required when library_type is 'group' and the server is configured for a user library.",
      +  "pattern": "^\\d+$",
      +  "type": "string"
      +}
    • addedInput schema / properties / library_type
      Added value: +{
      +  "description": "Override the configured Zotero library type for this call. Defaults to ZOTERO_LIBRARY_TYPE env (or 'user'). Use to target a different library per call without restarting the server.",
      +  "enum": [
      +    "user",
      +    "group"
      +  ],
      +  "type": "string"
      +}
  4. First observedv1.0.9

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose valuable behavior: search matches only titles, creator names and years, not abstracts, tags or full text, plus the defaults of dateAdded descending and limit 25. It stops short of confirming read-only semantics, result fields, or pagination behavior, which matters for a no-annotation tool.

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 mode/semantics statement is front-loaded, followed by a compact labeled example block and a closing pointer to downstream tools. No sentence is filler and the structure matches how an agent scans for invocation patterns.

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?

For a six-parameter, zero-required, read-oriented tool with no output schema or annotations, the description covers mode selection, search scope, defaults, and how to use the returned keys. It leaves return-value shape and library-targeting behavior unexplained, though the 100% schema coverage absorbs part of that gap.

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 coverage is 100%, so the schema already documents the six parameters including enums. The description still adds meaning by explaining what 'query' matches against and how empty/whitespace values are normalized, and by demonstrating sort/limit combinations. Library scoping parameters are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Search your Zotero library') and captures the dual nature of the tool ('or list items sorted by a field'). It does not distinguish itself from plausible siblings like get_collection_items or find_duplicates, but the core purpose is unambiguous.

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?

Gives an explicit conditional rule: with 'query' it searches, without an empty/whitespace 'query' it lists sorted up to 'limit'. Three worked examples make the two modes concrete, though there is no stated exclusion telling the agent when a sibling tool would be a better choice.

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