search_google_scholar
Search academic papers from Google Scholar to find relevant research publications using specific queries and return paper metadata.
Instructions
Search academic papers from Google Scholar.
Args: query: Search query string (e.g., 'machine learning'). max_results: Maximum number of papers to return (default: 10). Returns: List of paper metadata in dictionary format.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No |
Implementation Reference
- paper_search_mcp/server.py:422-432 (handler)The MCP tool handler `search_google_scholar` which calls the `async_search` helper.
async def search_google_scholar(query: str, max_results: int = 10) -> List[Dict]: """Search academic papers from Google Scholar. Args: query: Search query string (e.g., 'machine learning'). max_results: Maximum number of papers to return (default: 10). Returns: List of paper metadata in dictionary format. """ papers = await async_search(google_scholar_searcher, query, max_results) return papers if papers else [] - The implementation of the search logic for Google Scholar within the `GoogleScholarSearcher` class.
def search(self, query: str, max_results: int = 10) -> List[Paper]: """ Search Google Scholar with custom parameters """ papers = [] start = 0 results_per_page = min(10, max_results) while len(papers) < max_results: try: # Construct search parameters params = { 'q': query, 'start': start, 'hl': 'en', 'as_sdt': '0,5' # Include articles and citations } response = None for attempt in range(self.max_retries): self._rotate_user_agent() time.sleep(random.uniform(1.0, 2.5)) response = self.session.get(self.SCHOLAR_URL, params=params, timeout=30) if response.status_code == 200: break if response.status_code in (403, 429, 503): wait_time = self.retry_delay * (2 ** attempt) wait_time += random.uniform(0, 0.5) logger.warning( "Google Scholar returned %s (attempt %s/%s). Backing off %.1fs", response.status_code, attempt + 1, self.max_retries, wait_time, ) time.sleep(wait_time) continue