search-arxiv
Find academic articles on arXiv by entering a specific keyword to retrieve relevant scholarly content quickly and efficiently.
Instructions
Search arxiv for articles related to the given keyword.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes |
Implementation Reference
- src/mcp_scholarly/arxiv_search.py:37-39 (handler)Main execution function for the 'search-arxiv' tool logic, orchestrating search and parsing.def search(self, keyword, max_results=10) -> List[str]: results = self.arxiv_search(keyword, max_results) return self._parse_results(results)
- Helper method to perform the actual arXiv API search and retrieve results.def arxiv_search(self, keyword, max_results=10): search = arxiv.Search(query=keyword, max_results=max_results, sort_by=arxiv.SortCriterion.SubmittedDate) results = self.client.results(search) all_results = list(results) return all_results
- Static helper method to format arXiv search results into readable strings.@staticmethod def _parse_results(results): formatted_results = [] for result in results: title = result.title summary = result.summary links = "||".join([link.href for link in result.links]) pdf_url = result.pdf_url article_data = "\n".join([ f"Title: {title}", f"Summary: {summary}", f"Links: {links}", f"PDF URL: {pdf_url}", ]) formatted_results.append(article_data) return formatted_results
- src/mcp_scholarly/server.py:65-67 (handler)Dispatch handler in call_tool that invokes the ArxivSearch for 'search-arxiv' tool.if name == "search-arxiv": arxiv_search = ArxivSearch() formatted_results = arxiv_search.search(keyword)
- src/mcp_scholarly/server.py:18-28 (schema)Schema and registration of the 'search-arxiv' tool in the list_tools response.types.Tool( name="search-arxiv", description="Search arxiv for articles related to the given keyword.", inputSchema={ "type": "object", "properties": { "keyword": {"type": "string"}, }, "required": ["keyword"], }, ),