search-google-scholar
Retrieve academic articles from Google Scholar by entering specific keywords, facilitating research and access to scholarly resources.
Instructions
Search google scholar for articles related to the given keyword.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes |
Implementation Reference
- Executes the core logic of the 'search-google-scholar' tool by searching Google Scholar via the scholarly library and formatting results.def search_pubs(self, keyword) -> List[str]: search_results = self.scholarly.search_pubs(keyword) articles = self._parse_results(search_results) return articles
- Helper method to parse and format up to 10 search results from scholarly into strings.@staticmethod def _parse_results(search_results): articles = [] results_iter = 0 for searched_article in search_results: bib = searched_article.get('bib', {}) title = bib.get('title', 'No title') abstract = bib.get('abstract', 'No abstract available') pub_url = searched_article.get('pub_url', 'No URL available') article_string = f"Title: {title}\nAbstract: {abstract}\nURL: {pub_url}" articles.append(article_string) results_iter += 1 if results_iter >= MAX_RESULTS: break return articles
- src/mcp_scholarly/server.py:29-39 (schema)JSON schema definition for the tool's input: requires a 'keyword' string.types.Tool( name="search-google-scholar", description="Search google scholar for articles related to the given keyword.", inputSchema={ "type": "object", "properties": { "keyword": {"type": "string"}, }, "required": ["keyword"], }, )
- src/mcp_scholarly/server.py:68-70 (registration)Dispatch branch in handle_call_tool that instantiates GoogleScholar and invokes the tool handler.elif name == "search-google-scholar": google_scholar = GoogleScholar() formatted_results = google_scholar.search_pubs(keyword=keyword)
- src/mcp_scholarly/server.py:17-40 (registration)Tool registration in list_tools handler, defining both arxiv and google scholar tools.return [ types.Tool( name="search-arxiv", description="Search arxiv for articles related to the given keyword.", inputSchema={ "type": "object", "properties": { "keyword": {"type": "string"}, }, "required": ["keyword"], }, ), types.Tool( name="search-google-scholar", description="Search google scholar for articles related to the given keyword.", inputSchema={ "type": "object", "properties": { "keyword": {"type": "string"}, }, "required": ["keyword"], }, ) ]