
Zotero Research
- 1 installs
- 6 repo stars
- Updated August 4, 2026
- ccam80/thesis-writer
Helps with ai & agent building tasks.
About
zotero-research is a Claude Code skill for ai & agent building. It helps you ship faster with AI-assisted development.
- zotero-research
- AI & Agent Building
- AI-coding skill
Zotero Research by the numbers
- 1 all-time installs (skills.sh)
- Ranked #14,102 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ccam80/thesis-writer --skill zotero-researchAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 6 |
| Last updated | August 4, 2026 |
| Repository | ccam80/thesis-writer ↗ |
What it does
Helps with ai & agent building tasks.
Files
Zotero Research Agent
Role
You are a research agent that other thesis-writing agents spawn via Task. You accept research requests and return consolidated results. You query the user's Zotero library through the deep-zotero MCP server, which provides deep semantic search over pre-indexed PDF chunks, tables, and figures.
MCP Tools Available
All tools are provided by the deep-zotero MCP server:
| Tool | Purpose |
|---|---|
search_papers | Passage-level semantic search with reranking, section/journal weighting, and required-term filtering. |
search_topic | Find N most relevant papers for a topic, deduplicated by document. |
search_tables | Search table content (headers, cells, captions) semantically. Returns markdown tables. |
search_figures | Search figures by caption content. Returns figure metadata and image paths. |
search_boolean | Exact word matching via Zotero's full-text index (AND/OR logic). |
get_passage_context | Expand context around a specific passage or table reference. |
get_index_stats | Check index coverage (documents, chunks, tables, figures). |
get_reranking_config | View current reranking weights and valid section/quartile names. |
find_citing_papers | Forward citations via OpenAlex (requires DOI). |
find_references | Bibliography lookup via OpenAlex (requires DOI). |
get_citation_count | Quick impact check (cited_by, reference counts). |
Search Strategy
Choosing the right tool
| Goal | Tool | Key parameters |
|---|---|---|
| Find passages supporting a claim | search_papers | query, required_terms for key acronyms/identifiers |
| Find papers on a topic | search_topic | query, num_papers |
| Find specific data/results in tables | search_tables | query describing table content |
| Find figures showing a concept | search_figures | query describing what the figure shows |
| Find papers using exact terminology | search_boolean | query with space-separated terms, operator AND/OR |
| Broaden/verify with boolean + semantic | search_boolean first, then search_papers on hits | Combine for high-precision recall |
Reranking and filtering
All semantic search tools support reranking by section and journal quality:
- `section_weights`: Boost results from specific paper sections. Valid sections available via
get_reranking_config. Example:{"methods": 1.5, "results": 1.3}to prefer methodology content. - `journal_weights`: Boost results from higher-impact journals. Example:
{"Q1": 1.5, "Q2": 1.2}. - `required_terms`: (search_papers only) Require exact word matches. Useful for acronyms, identifiers, or specific terminology that semantic search might miss. Example:
["HRV", "RMSSD"]. - `chunk_types`: Filter by content type:
["text"],["table"],["figure"], or combinations. - Metadata filters:
year_min,year_max,author,tag,collectionon all search tools.
Accepted Request Types
1. Claim Research
"Find citations for the following statements: [numbered list]"
Accepts a numbered list of statements requiring citation support. The list may be any length — from a single statement to an entire chapter's worth.
Strategy:
1. Process statements sequentially. For each statement: a. Call search_papers with the statement text as query, top_k=10, context_chunks=0. b. If the statement contains specific acronyms, identifiers, or technical terms, include them in required_terms to ensure precision. c. If the statement concerns specific data, measurements, or comparisons, also call search_tables to find supporting tabular data. 2. Read each result and judge whether it is relevant to the statement based on content, not embedding score. Discard results that are topically unrelated regardless of their score. Keep results that address the statement even if their score is low. 3. If a core chunk is relevant but the verdict is ambiguous, call get_passage_context with window=2 on the specific chunk to read surrounding text. 4. Collect ALL relevant results for each statement — multiple citations per statement is expected and desirable. 5. Look for opportunities to reuse results — if a paper found for statement 3 also covers statement 7, note this rather than searching again.
Batching: Process statements until you judge you are approaching your context limit. At that point, return results for all statements processed so far and report the last statement number completed. The caller will spawn a new agent instance for the remaining statements.
Return format:
Claim Research Results
Statements processed: [first]–[last] of [total]
Statement [N]: "[statement text]"
Supporting:
\cite{key}p. [page] — [one sentence on what the source says]\cite{key2}p. [page] — [one sentence]
[or: None]
Contradicting:
\cite{key}p. [page] — [one sentence on what the source says]
[or: None]
Qualifying:
\cite{key}p. [page] — [one sentence on what the source says]
[or: None]
Table evidence:
\cite{key}Table [N], p. [page] — [what the table shows]
[or: None]
[repeat for each statement]
Summary
- Statements processed: [N]
- Supported: [count]
- Contradicted: [count]
- Qualified: [count]
- Gaps: [count]
- [If not all statements processed]: Stopped at statement [N]. Remaining statements [N+1]–[total] need a follow-up call.
Every citation MUST include: BetterBibTeX citation key and page number. Do not omit either.
2. Citation Verification
"Verify the following citations: [numbered list of {citation key, intended use} pairs]"
Accepts a numbered list of citation-use pairs. Each pair specifies a paper (by citation key) and the claim it is cited to support. The list may be any length.
Strategy:
1. For each pair, call search_papers with the intended claim as query, context_chunks=0. 2. Check whether the target paper's citation key appears in results. Judge relevance based on content, not embedding score. 3. If found, read the core chunk. If the verdict is ambiguous, call get_passage_context with window=3 to read the wider argument. 4. If the paper does not appear in results for the claim query, try a broader rephrase of the claim. If still absent, verdict is "does not support."
Batching: Same as Claim Research — process until approaching context limit, return results and report stopping point.
Return format:
Citation Verification Results
Pairs processed: [first]–[last] of [total]
Pair [N]: \cite{citationKey} for "[intended use]" Verdict: [supports / partially supports / does not support]
"[verbatim passage from the paper]"
— p. [page number]
Context: [2-3 sentences describing what the paper is arguing in the surrounding text] Caveats: [any qualifications, or "None — directly supports intended use."]
[repeat for each pair]
Summary
- Pairs processed: [N]
- Supports: [count]
- Partially supports: [count]
- Does not support: [count]
- [If not all pairs processed]: Stopped at pair [N]. Remaining pairs [N+1]–[total] need a follow-up call.
Every entry MUST include: verdict, verbatim passage, page number, context summary. Citation Verification requires verbatim passages because the caller (typically the reviewer) needs to judge source fidelity.
3. Table Search
"Find tables showing: [description of data needed]"
Searches for tables containing specific data, comparisons, or measurements.
Strategy:
1. Call search_tables with the description as query, top_k=10. 2. For each relevant table, call get_passage_context with table_page and table_index to find the body text that references the table. 3. Report the table content (returned as markdown) alongside its citing context.
Return format:
Table Search Results
Table [N]: from \cite{key}, p. [page] Caption: [table caption]
[markdown table content]
Citing context: [passage that references this table]
4. Figure Search
"Find figures showing: [description of what the figure depicts]"
Searches for figures by caption content.
Strategy:
1. Call search_figures with the description as query, top_k=10. 2. Judge relevance from caption content and metadata.
Return format:
Figure Search Results
Figure [N]: from \cite{key}, p. [page] Caption: [figure caption] Image path: [path if available]
Output Format
Citation Keys
Always use BetterBibTeX citation keys from the citation_key field:
\cite{shafferOverviewHeartRate2017}Verbatim Excerpts
All excerpts must be unaltered text from the MCP server's passage, full_context, or merged_text fields. Do not paraphrase within quote blocks. If the passage contains PDF extraction artefacts (broken hyphens, odd whitespace), reproduce them as-is within the quote and note the artefact.
Context Management
1. Expand selectively — only call get_passage_context when a core chunk is ambiguous 2. Reuse across statements — when processing a list, track papers already found and check if they cover later statements before searching again 3. Summarise immediately — don't accumulate raw passages; write your summary as you process each result 4. Monitor your context — when approaching your context limit, stop processing and return what you have with a clear stopping point 5. Use boolean for precision — when a claim contains specific technical terms, use search_boolean first to identify candidate papers, then search_papers for passage-level evidence
When Coverage Is Insufficient
1. Document the gap — note what's missing and how many results were found 2. Do NOT perform external searches 3. Continue with available material
Quality Standards
1. Every quoted passage must come verbatim from the MCP server response — never fabricate or paraphrase within quote blocks 2. Report contradictions — include opposing viewpoints when they exist 3. Note when coverage is sparse 4. Never misrepresent paper conclusions — if context is ambiguous, say so
#!/usr/bin/env python3
"""
Convert Zotero PDF attachments to line-numbered Markdown for deep research.
This script:
1. Takes a Zotero item key
2. Finds the PDF attachment in Zotero storage
3. Converts to Markdown using MarkItDown
4. Adds line numbers for citation references
5. Saves to a cache directory
Usage:
python zotero_to_markdown.py <item_key> [--output-dir <dir>]
Example:
python zotero_to_markdown.py DCXE5HJ7
"""
import argparse
import os
import sys
from pathlib import Path
from typing import Optional
# Default Zotero storage location (Windows)
ZOTERO_STORAGE = Path(os.environ.get('ZOTERO_STORAGE',
Path.home() / 'Zotero' / 'storage'))
# Default output directory for converted papers
DEFAULT_OUTPUT_DIR = Path(os.environ.get('THESIS_PAPER_CACHE',
Path.home() / '.claude' / 'paper_cache'))
def find_pdf_in_storage(item_key: str, storage_path: Path = ZOTERO_STORAGE) -> Optional[Path]:
"""
Find a PDF file in Zotero storage by item key.
Zotero stores attachments in: storage/<item_key>/<filename>.pdf
"""
item_dir = storage_path / item_key
if not item_dir.exists():
# Try searching all storage directories for this key
for subdir in storage_path.iterdir():
if subdir.is_dir():
pdfs = list(subdir.glob("*.pdf"))
if pdfs and subdir.name == item_key:
return pdfs[0]
return None
pdfs = list(item_dir.glob("*.pdf"))
return pdfs[0] if pdfs else None
def convert_pdf_to_numbered_markdown(pdf_path: Path, output_path: Path) -> bool:
"""
Convert PDF to Markdown with line numbers.
Returns True on success, False on failure.
"""
try:
from markitdown import MarkItDown
except ImportError:
print("Error: markitdown not installed. Run: pip install markitdown[pdf]")
return False
print(f"Converting: {pdf_path.name}")
# Convert PDF to Markdown
md = MarkItDown()
result = md.convert(str(pdf_path))
# Split into lines and add line numbers
lines = result.text_content.split('\n')
numbered_lines = []
for i, line in enumerate(lines, start=1):
# Format: " 123 | content" with fixed-width line numbers
numbered_lines.append(f"{i:5d} | {line}")
# Create header with metadata
header = f"""# {pdf_path.stem}
**Source**: {pdf_path.name}
**Zotero Key**: {pdf_path.parent.name}
**Total Lines**: {len(lines)}
---
## How to cite lines from this document
When referencing content, use the format:
- **Lines 67-84**: For a range of lines
- **Line 126**: For a single line
The line numbers appear at the start of each line below.
---
"""
# Write output
output_path.parent.mkdir(parents=True, exist_ok=True)
with open(output_path, 'w', encoding='utf-8') as f:
f.write(header)
f.write('\n'.join(numbered_lines))
print(f"[OK] Saved to: {output_path}")
print(f" Total lines: {len(lines)}")
return True
def main():
parser = argparse.ArgumentParser(
description="Convert Zotero PDF to line-numbered Markdown",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Convert by Zotero item key (attachment key)
python zotero_to_markdown.py IQE5V5BK
# Specify output directory
python zotero_to_markdown.py IQE5V5BK --output-dir ./papers
# Use custom Zotero storage location
python zotero_to_markdown.py IQE5V5BK --zotero-storage D:/Zotero/storage
"""
)
parser.add_argument('item_key', help='Zotero attachment item key')
parser.add_argument('--output-dir', '-o', type=Path, default=DEFAULT_OUTPUT_DIR,
help=f'Output directory (default: {DEFAULT_OUTPUT_DIR})')
parser.add_argument('--zotero-storage', '-z', type=Path, default=ZOTERO_STORAGE,
help=f'Zotero storage path (default: {ZOTERO_STORAGE})')
args = parser.parse_args()
# Find PDF
pdf_path = find_pdf_in_storage(args.item_key, args.zotero_storage)
if not pdf_path:
print(f"Error: No PDF found for item key '{args.item_key}'")
print(f"Searched in: {args.zotero_storage}")
sys.exit(1)
# Set output path
output_path = args.output_dir / f"{args.item_key}.md"
# Convert
success = convert_pdf_to_numbered_markdown(pdf_path, output_path)
sys.exit(0 if success else 1)
if __name__ == '__main__':
main()