search-google-scholar
Search academic articles on Google Scholar using keywords to find relevant research papers and scholarly publications.
Instructions
Search google scholar for articles related to the given keyword.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes |
Implementation Reference
- Core handler function that performs the Google Scholar publication search using the scholarly library and delegates parsing to _parse_results.
def search_pubs(self, keyword) -> List[str]: search_results = self.scholarly.search_pubs(keyword) articles = self._parse_results(search_results) return articles - Static helper method that parses raw search results into formatted strings for up to 10 articles, extracting title, abstract, and publication URL.
@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 (registration)Registration of the tool in the @server.list_tools() handler, including name, description, and input schema definition.
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 (handler)Dispatch logic in the @server.call_tool() handler that instantiates the GoogleScholar class and calls its search_pubs method.
elif name == "search-google-scholar": google_scholar = GoogleScholar() formatted_results = google_scholar.search_pubs(keyword=keyword) - src/mcp_scholarly/server.py:32-38 (schema)JSON schema defining the tool's input: an object with a required 'keyword' string property.
inputSchema={ "type": "object", "properties": { "keyword": {"type": "string"}, }, "required": ["keyword"], },