download_pubmed
Download PDF files of PubMed research papers by providing the PubMed ID (PMID) and specifying a save directory for academic access.
Instructions
Attempt to download PDF of a PubMed paper.
Args: paper_id: PubMed ID (PMID). save_path: Directory to save the PDF (default: './downloads'). Returns: str: Message indicating that direct PDF download is not supported.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper_id | Yes | ||
| save_path | No | ./downloads |
Implementation Reference
- paper_search_mcp/server.py:466-478 (handler)The 'download_pubmed' tool handler in the MCP server, which wraps the platform-specific 'download_pdf' call.
async def download_pubmed(paper_id: str, save_path: str = "./downloads") -> str: """Attempt to download PDF of a PubMed paper. Args: paper_id: PubMed ID (PMID). save_path: Directory to save the PDF (default: './downloads'). Returns: str: Message indicating that direct PDF download is not supported. """ try: return pubmed_searcher.download_pdf(paper_id, save_path) except NotImplementedError as e: return str(e) - The 'download_pdf' implementation in the PubMedSearcher class, which explicitly raises a NotImplementedError as PubMed does not support direct PDF downloads.
def download_pdf(self, paper_id: str, save_path: str) -> str: """Attempt to download a paper's PDF from PubMed. Args: paper_id: PubMed ID (PMID) save_path: Directory to save the PDF Returns: str: Error message indicating PDF download is not supported Raises: NotImplementedError: Always raises this error as PubMed doesn't provide direct PDF access """ message = ("PubMed does not provide direct PDF downloads. " "Please use the paper's DOI or URL to access the publisher's website.") raise NotImplementedError(message)