Source code for tooluniverse.biorxiv_tool

import requests
from .base_tool import BaseTool
from .tool_registry import register_tool


[docs] @register_tool("BioRxivTool") class BioRxivTool(BaseTool): """ Search bioRxiv preprints using bioRxiv's API (same interface as medRxiv). Arguments: query (str): Search term max_results (int): Max results to return (default 10, max 200) """
[docs] def __init__( self, tool_config, base_url="https://api.biorxiv.org/details", ): super().__init__(tool_config) self.base_url = base_url
[docs] def run(self, arguments=None): arguments = arguments or {} query = arguments.get("query") max_results = int(arguments.get("max_results", 10)) if not query: return {"error": "`query` parameter is required."} return self._search(query, max_results)