scholar
- google_scholar_search_mcp.scholar.require_identifier(title, scholar_id)[source]
Ensure at least one way to identify a paper was given.
- Parameters:
- Raises:
ScholarInvalidArgumentError – If both are empty.
- class google_scholar_search_mcp.scholar.ScholarClient(config)[source]
Bases:
objectSynchronous wrapper around
scholarlythat returns typed models.- ensure_available()[source]
Fail fast while Scholar is known to be blocking this client.
- Raises:
ScholarBlockedError – During the cooldown after a detected block.
- search_pubs(query, max_results=10, year_low=None, year_high=None, sort_by='relevance', patents=True, offset=0)[source]
Search publications by keyword.
- Parameters:
query (str) – Search query.
max_results (int) – Maximum number of papers to return.
year_low (int | None) – Earliest publication year.
year_high (int | None) – Latest publication year.
sort_by (str) –
"relevance"or"date".patents (bool) – Whether to include patents.
offset (int) – Number of leading results to skip (for paging).
- Returns:
list[PaperResult] – Up to
max_resultspapers, starting atoffset; empty when the offset is past the last result.- Raises:
ScholarBlockedError – If Scholar answers with a bot check instead of results.
MaxTriesExceededException – If Scholar blocks the request (raised by
scholarly).
- Return type:
- get_paper_details(title=None, *, scholar_id=None)[source]
Fetch full details and BibTeX of a paper.
- Parameters:
- Returns:
PaperDetails – Details of the identified paper.
- Raises:
ScholarInvalidArgumentError – If no identifier is given.
ScholarNotFoundError – If nothing matches.
- Return type:
- get_citations(title=None, max_results=10, *, scholar_id=None, offset=0)[source]
Fetch papers that cite a paper.
With
scholar_idthe cited paper is not fetched (saving a request), so its title isNoneand the total comes from the result page header.- Parameters:
- Returns:
tuple[str | None, int | None, list[PaperResult]] – The cited paper’s title (if known), its total citation count (if known) and the citing papers.
- Raises:
ScholarInvalidArgumentError – If no identifier is given.
ScholarNotFoundError – If the paper is not found.
- Return type:
tuple[str | None, int | None, list[PaperResult]]
- get_bibtex(title=None, *, scholar_id=None)[source]
Get the BibTeX entry of a paper.
- Parameters:
- Returns:
str – BibTeX entry.
- Raises:
ScholarInvalidArgumentError – If no identifier is given.
ScholarNotFoundError – If nothing matches.
- Return type: