search_medrxiv
Search medical preprints on medRxiv by category to find clinical research studies in epidemiology, cardiology, oncology, and other medical fields.
Instructions
Search medical preprints on medRxiv.
USE THIS TOOL WHEN:
- Searching for clinical/medical research preprints
- You need latest COVID-19, epidemiology, or clinical studies
- Searching by CATEGORY, not keyword (see below)
DOMAIN: Epidemiology, Infectious Diseases, Cardiology, Oncology,
Public Health, Psychiatry, Health Informatics, etc.
NOTE: medRxiv search uses CATEGORY names, not keywords.
Categories: 'infectious_diseases', 'epidemiology', 'cardiology',
'oncology', 'health_informatics', 'psychiatry', etc.
WORKFLOW:
1. search_medrxiv(category) -> get DOI
2. download_medrxiv(doi) or read_medrxiv_paper(doi)
Args:
query: Category name (e.g., 'infectious_diseases', 'epidemiology').
max_results: Number of results (default: 10).
Returns:
List of recent preprints in that category.
Example:
search_medrxiv("infectious_diseases", max_results=5)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No |
Implementation Reference
- paper_find_mcp/server.py:368-398 (handler)Handler function for the 'search_medrxiv' tool. Decorated with @mcp.tool() for automatic MCP registration. Delegates to the generic _search helper using the 'medrxiv' searcher.@mcp.tool() async def search_medrxiv(query: str, max_results: int = 10) -> List[Dict]: """Search medical preprints on medRxiv. USE THIS TOOL WHEN: - Searching for clinical/medical research preprints - You need latest COVID-19, epidemiology, or clinical studies - Searching by CATEGORY, not keyword (see below) DOMAIN: Epidemiology, Infectious Diseases, Cardiology, Oncology, Public Health, Psychiatry, Health Informatics, etc. NOTE: medRxiv search uses CATEGORY names, not keywords. Categories: 'infectious_diseases', 'epidemiology', 'cardiology', 'oncology', 'health_informatics', 'psychiatry', etc. WORKFLOW: 1. search_medrxiv(category) -> get DOI 2. download_medrxiv(doi) or read_medrxiv_paper(doi) Args: query: Category name (e.g., 'infectious_diseases', 'epidemiology'). max_results: Number of results (default: 10). Returns: List of recent preprints in that category. Example: search_medrxiv("infectious_diseases", max_results=5) """ return await _search('medrxiv', query, max_results)
- paper_find_mcp/server.py:75-85 (registration)Global SEARCHERS dictionary registers the MedRxivSearcher instance under 'medrxiv' key, used by _search to dispatch to platform-specific logic.SEARCHERS = { 'arxiv': ArxivSearcher(), 'pubmed': PubMedSearcher(), 'biorxiv': BioRxivSearcher(), 'medrxiv': MedRxivSearcher(), 'google_scholar': GoogleScholarSearcher(), 'iacr': IACRSearcher(), 'semantic': SemanticSearcher(), 'crossref': CrossRefSearcher(), 'repec': RePECSearcher(), }
- paper_find_mcp/server.py:95-112 (helper)Generic _search helper function that dispatches to the specific searcher (MedRxivSearcher for 'medrxiv') and converts Paper objects to dicts.async def _search( searcher_name: str, query: str, max_results: int = 10, **kwargs ) -> List[Dict]: """通用搜索函数""" searcher = SEARCHERS.get(searcher_name) if not searcher: logger.error(f"Unknown searcher: {searcher_name}") return [] try: papers = searcher.search(query, max_results=max_results, **kwargs) return [paper.to_dict() for paper in papers] except Exception as e: logger.error(f"Search failed for {searcher_name}: {e}") return []
- Core search implementation in MedRxivSearcher.search(). Queries the bioRxiv API (shared with medRxiv), paginates results by category and date range, parses into Paper objects. This is the platform-specific logic executed by the tool.def search(self, query: str, max_results: int = 10, days: int = 30) -> List[Paper]: """搜索 medRxiv 论文 Args: query: 分类名称(如 "cardiovascular medicine", "infectious diseases") max_results: 最大返回数量 days: 搜索最近 N 天的论文 Returns: List[Paper]: 论文列表 """ end_date = datetime.now().strftime('%Y-%m-%d') start_date = (datetime.now() - timedelta(days=days)).strftime('%Y-%m-%d') # 格式化分类 category = query.lower().replace(' ', '_') papers = [] cursor = 0 while len(papers) < max_results: url = f"{self.BASE_URL}/{start_date}/{end_date}/{cursor}" if category: url += f"?category={category}" response = self._make_request(url) if not response: break try: data = response.json() collection = data.get('collection', []) except Exception as e: logger.error(f"Failed to parse response: {e}") break if not collection: break for item in collection: if len(papers) >= max_results: break paper = self._parse_item(item) if paper: papers.append(paper) if len(collection) < 100: break # 没有更多结果 cursor += 100 logger.info(f"Found {len(papers)} papers for query: {query}") return papers[:max_results]