download_iacr
Download PDF files of IACR ePrint papers using paper IDs to access cryptographic research documents for academic use.
Instructions
Download PDF of an IACR ePrint paper.
Args: paper_id: IACR paper ID (e.g., '2009/101'). save_path: Directory to save the PDF (default: './downloads'). Returns: Path to the downloaded PDF file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper_id | Yes | ||
| save_path | No | ./downloads |
Implementation Reference
- The actual download_pdf method of IACRSearcher class which performs the PDF file download from IACR ePrint Archive.
def download_pdf(self, paper_id: str, save_path: str) -> str: """ Download PDF from IACR ePrint Archive Args: paper_id: IACR paper ID (e.g., "2025/1014") save_path: Path to save the PDF Returns: str: Path to downloaded file or error message """ try: pdf_url = f"{self.IACR_BASE_URL}/{paper_id}.pdf" response = self.session.get(pdf_url) if response.status_code == 200: filename = f"{save_path}/iacr_{paper_id.replace('/', '_')}.pdf" os.makedirs(save_path, exist_ok=True) with open(filename, "wb") as f: f.write(response.content) return filename else: return f"Failed to download PDF: HTTP {response.status_code}" except Exception as e: logger.error(f"PDF download error: {e}") return f"Error downloading PDF: {e}" - paper_search_mcp/server.py:508-517 (handler)The tool handler function download_iacr which calls the underlying iacr_searcher.download_pdf implementation.
async def download_iacr(paper_id: str, save_path: str = "./downloads") -> str: """Download PDF of an IACR ePrint paper. Args: paper_id: IACR paper ID (e.g., '2009/101'). save_path: Directory to save the PDF (default: './downloads'). Returns: Path to the downloaded PDF file. """ return iacr_searcher.download_pdf(paper_id, save_path)