bc_search_google_scholar_publications
Search Google Scholar for publications by keyword or author. Get publication details including title, authors, venue, year, citations, abstract, and BibTeX entry.
Instructions
Search Google Scholar for publications with support for author search using 'author:"Name"' syntax. WARNING: Use responsibly, may block excessive queries.
Returns: dict: Publications list with title, authors, venue, year, citations, abstract, bib entry or error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g., 'machine learning' or 'author:"John Smith" deep learning') | |
| max_results | No | Maximum number of publications to return (1-50) | |
| use_proxy | No | Use free proxies to avoid rate limiting |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The actual tool handler function 'search_google_scholar_publications' decorated with @core_mcp.tool(). Searches Google Scholar for publications using the scholarly library, supports proxy configuration, author search syntax, and returns publication metadata (title, author, venue, year, citations, abstract, URLs).
@core_mcp.tool() def search_google_scholar_publications( query: Annotated[ str, Field(description="Search query (e.g., 'machine learning' or 'author:\"John Smith\" deep learning')"), ], max_results: Annotated[int, Field(description="Maximum number of publications to return (1-50)", ge=1, le=50)] = 10, use_proxy: Annotated[bool, Field(description="Use free proxies to avoid rate limiting")] = True, ) -> Dict[str, Any]: """Search Google Scholar for publications with support for author search using 'author:"Name"' syntax. WARNING: Use responsibly, may block excessive queries. Returns: dict: Publications list with title, authors, venue, year, citations, abstract, bib entry or error message. """ try: # Set up proxy if requested if use_proxy: try: pg = ProxyGenerator() pg.FreeProxies() scholarly.use_proxy(pg) logger.info("Proxy configured for Google Scholar requests") except Exception as e: logger.warning(f"Failed to set up proxy: {e}") # Continue without proxy # Search for publications search_query = scholarly.search_pubs(query) publications = [] for count, pub in enumerate(search_query): if count >= max_results: break # Extract publication information bib = pub.get("bib", {}) pub_info = { "title": bib.get("title", ""), "author": bib.get("author", ""), "venue": bib.get("venue", ""), "pub_year": bib.get("pub_year", ""), "abstract": bib.get("abstract", ""), "pub_url": bib.get("pub_url", ""), "eprint_url": pub.get("eprint_url", ""), "num_citations": pub.get("num_citations", 0), "citedby_url": pub.get("citedby_url", ""), "url_scholarbib": pub.get("url_scholarbib", ""), } publications.append(pub_info) return {"query": query, "total_found": len(publications), "publications": publications} except Exception as e: logger.error(f"Error searching Google Scholar publications: {e}") return { "error": f"Failed to search Google Scholar publications: {e!s}", "note": "Google Scholar may be blocking requests. Publication searches are particularly risky. Try again later or use alternative databases like PubMed/EuropePMC.", } - Input schema for the tool: query (str, required), max_results (int, 1-50, default 10), use_proxy (bool, default True) — all defined using Pydantic Field annotations.
def search_google_scholar_publications( query: Annotated[ str, Field(description="Search query (e.g., 'machine learning' or 'author:\"John Smith\" deep learning')"), ], max_results: Annotated[int, Field(description="Maximum number of publications to return (1-50)", ge=1, le=50)] = 10, use_proxy: Annotated[bool, Field(description="Use free proxies to avoid rate limiting")] = True, - Tool registration via @core_mcp.tool() decorator on the function. The 'core_mcp' FastMCP server instance is imported from biocontext_kb/core/_server.py.
@core_mcp.tool() - src/biocontext_kb/core/_server.py:3-6 (registration)The FastMCP server instance 'core_mcp' that registers the tool via the @core_mcp.tool() decorator.
core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", ) - Re-exports search_google_scholar_publications from the _search_publications module, making it part of the scholarly package's public API.
from ._search_publications import search_google_scholar_publications __all__ = [ "search_google_scholar_publications", ]