Skip to main content
Glama
adityak74

MCP Scholarly Server

by adityak74

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
NameRequiredDescriptionDefault
keywordYes

Implementation Reference

  • 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
  • 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)
  • 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"], }, ),

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/adityak74/mcp-scholarly'

If you have feedback or need assistance with the MCP directory API, please join our Discord server