bc_get_biorxiv_preprint_details
Retrieve detailed metadata for bioRxiv or medRxiv preprints using a DOI. This tool extracts research information to support biomedical discovery and analysis.
Instructions
Get detailed information about a specific preprint by DOI.
This tool retrieves detailed metadata for a single preprint from bioRxiv or medRxiv using its DOI identifier.
Args: doi (str): DOI of the preprint (e.g., '10.1101/2020.09.09.20191205'). server (str): Server to search - 'biorxiv' or 'medrxiv' (default: 'biorxiv').
Returns: dict: Detailed preprint information or error message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doi | Yes | DOI of the preprint (e.g., '10.1101/2020.09.09.20191205') | |
| server | No | Server to search: 'biorxiv' or 'medrxiv' | biorxiv |
Implementation Reference
- Main handler for the biorxiv preprint details tool. Note: tool name in code is 'get_biorxiv_preprint_details'; no 'bc_' prefix found in codebase, but this matches the functionality exactly.@core_mcp.tool() def get_biorxiv_preprint_details( doi: Annotated[str, Field(description="Preprint DOI (e.g., '10.1101/2020.09.09.20191205')")], server: Annotated[str, Field(description="'biorxiv' or 'medrxiv'")] = "biorxiv", ) -> Dict[str, Any]: """Get detailed preprint metadata by DOI. Retrieves title, authors, abstract, date, version, category, license, and publication status. Returns: dict: Preprint metadata including doi, title, authors, abstract, date, version, category, license, publication status or error message. """ # Validate server if server.lower() not in ["biorxiv", "medrxiv"]: return {"error": "Server must be 'biorxiv' or 'medrxiv'"} server = server.lower() # Clean DOI - remove URL prefix if present if doi.startswith("https://doi.org/"): doi = doi.replace("https://doi.org/", "") elif doi.startswith("doi:"): doi = doi.replace("doi:", "") try: # Build URL for single DOI lookup url = f"https://api.biorxiv.org/details/{server}/{doi}/na/json" # Make request response = requests.get(url, timeout=30) response.raise_for_status() data = response.json() # Check if paper was found collection = data.get("collection", []) if not collection: return {"error": f"No preprint found with DOI {doi} on {server}", "messages": data.get("messages", [])} # Get the paper details paper = collection[0] # Return structured paper information result = { "doi": paper.get("doi", ""), "title": paper.get("title", ""), "authors": paper.get("authors", ""), "corresponding_author": paper.get("author_corresponding", ""), "corresponding_institution": paper.get("author_corresponding_institution", ""), "date": paper.get("date", ""), "version": paper.get("version", ""), "type": paper.get("type", ""), "license": paper.get("license", ""), "category": paper.get("category", ""), "abstract": paper.get("abstract", ""), "published": paper.get("published", ""), "server": paper.get("server", server), "jats_xml_path": paper.get("jats", ""), } return result except requests.exceptions.RequestException as e: logger.error(f"Error retrieving preprint {doi} from {server}: {e}") return {"error": f"Failed to retrieve preprint from {server}: {e!s}"} except Exception as e: logger.error(f"Unexpected error retrieving preprint {doi}: {e}") return {"error": f"Unexpected error: {e!s}"}
- src/biocontext_kb/core/_server.py:1-7 (registration)FastMCP server instance creation ('BC') to which tools are registered via @core_mcp.tool() decorators.from fastmcp import FastMCP core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )
- src/biocontext_kb/core/biorxiv/__init__.py:8-14 (registration)Exposes the tool function for import, triggering registration via decorator.from ._get_preprint_details import get_biorxiv_preprint_details from ._get_recent_biorxiv_preprints import get_recent_biorxiv_preprints __all__ = [ "get_biorxiv_preprint_details", "get_recent_biorxiv_preprints", ]
- Pydantic schema definitions for input parameters (DOI, server) and output Dict[str, Any].def get_biorxiv_preprint_details( doi: Annotated[str, Field(description="Preprint DOI (e.g., '10.1101/2020.09.09.20191205')")], server: Annotated[str, Field(description="'biorxiv' or 'medrxiv'")] = "biorxiv", ) -> Dict[str, Any]:
- src/biocontext_kb/core/__init__.py:6-6 (registration)Imports biorxiv tools, executing decorators for registration on core_mcp.from .biorxiv import *