download_openalex
Download PDFs for academic papers using OpenAlex paper IDs. Save files to specified directories for research access.
Instructions
Download PDF for a paper from OpenAlex.
Args: paper_id: OpenAlex paper ID. save_path: Directory to save the PDF (default: './downloads'). Returns: str: Error message, typically OpenAlex relies on extracted pdf_url instead of direct downloads.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper_id | Yes | ||
| save_path | No | ./downloads |
Implementation Reference
- paper_search_mcp/server.py:1281-1290 (handler)The 'download_openalex' tool handler in 'paper_search_mcp/server.py'. It calls 'openalex_searcher.download_pdf'.
async def download_openalex(paper_id: str, save_path: str = "./downloads") -> str: """Download PDF for a paper from OpenAlex. Args: paper_id: OpenAlex paper ID. save_path: Directory to save the PDF (default: './downloads'). Returns: str: Error message, typically OpenAlex relies on extracted pdf_url instead of direct downloads. """ return await asyncio.to_thread(openalex_searcher.download_pdf, paper_id, save_path) - The 'download_pdf' method in 'OpenAlexSearcher' class. It is currently implemented to raise NotImplementedError, reflecting that OpenAlex does not support direct PDF downloads.
def download_pdf(self, paper_id: str, save_path: str) -> str: """ OpenAlex does not host PDFs natively, it only links to open access versions. """ raise NotImplementedError( "OpenAlex does not provide direct PDF downloads natively. " "Please use the extracted 'pdf_url' if available, or DOI for fallback." )