Zotero Read
Zotero Read Tool
This LangGraph tool searches a user's Zotero library for items matching a query and optionally downloads their PDF attachments. It returns structured metadata for each found item and makes the results available as an artifact.
ZoteroSearchInput
Bases: BaseModel
Input schema for the Zotero search tool.
Attributes:
Name | Type | Description |
---|---|---|
query |
str
|
Search string to match against item metadata. |
only_articles |
bool
|
If True, restrict results to 'journalArticle' and similar types. |
limit |
int
|
Maximum number of items to fetch from Zotero. |
download_pdfs |
bool
|
If True, download PDF attachments for each item. |
tool_call_id |
str
|
Internal identifier for this tool invocation. |
Source code in aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
zotero_read(query, only_articles, tool_call_id, limit=2, download_pdfs=False)
Execute a search on the Zotero library and return matching items.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
str
|
Text query to search in titles, abstracts, tags, etc. |
required |
only_articles
|
bool
|
When True, only include items of type 'journalArticle' |
required |
tool_call_id
|
str
|
Internal ID injected by LangGraph to track this tool call. |
required |
limit
|
int
|
Max number of items to return (1–100). Defaults to 2. |
2
|
download_pdfs
|
bool
|
If True, PDFs for each returned item will be downloaded now. If False, only metadata is fetched. Defaults to False. |
False
|
Returns:
Type | Description |
---|---|
Command[Any]
|
Command[Any]: A LangGraph Command updating the agent state: - 'article_data': dict mapping item keys to metadata (and 'pdf_url' if downloaded). - 'last_displayed_papers': identifier pointing to the articles in state. - 'messages': list containing a ToolMessage with a human-readable summary and an 'artifact' referencing the raw article_data. |
Source code in aiagents4pharma/talk2scholars/tools/zotero/zotero_read.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|