download_ssrn
Download PDFs for academic papers from SSRN using paper identifiers. Note: SSRN connector provides metadata only and does not support actual file downloads.
Instructions
Download PDF for a paper from SSRN.
Note: SSRN connector is metadata-only and download is not supported.
Args: paper_id: SSRN paper identifier. save_path: Directory to save the PDF (unused). Returns: str: Error message from metadata-only SSRN connector.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paper_id | Yes | ||
| save_path | No | ./downloads |
Implementation Reference
- paper_search_mcp/server.py:1253-1264 (handler)The 'download_ssrn' handler in 'server.py', which acts as the wrapper function for the tool. Note that it delegates to the 'SSRNSearcher' and documentation notes it is a metadata-only connector.
async def download_ssrn(paper_id: str, save_path: str = "./downloads") -> str: """Download PDF for a paper from SSRN. Note: SSRN connector is metadata-only and download is not supported. Args: paper_id: SSRN paper identifier. save_path: Directory to save the PDF (unused). Returns: str: Error message from metadata-only SSRN connector. """ return ssrn_searcher.download_pdf(paper_id, save_path) - The 'SSRNSearcher.download_pdf' implementation in 'ssrn.py'. This contains the logic (or lack thereof, as it is a best-effort/metadata-only service) for downloading PDFs from SSRN.
def download_pdf(self, paper_id: str, save_path: str = "./downloads") -> str: """Download PDF for an SSRN paper when a public direct link is available. SSRN frequently requires login for PDF delivery. This method is best-effort only and returns an explanatory message when no accessible public PDF link can be resolved. Args: paper_id: SSRN ID in ``ssrn:<id>`` format, raw numeric id, or URL. save_path: Directory to save downloaded PDF. Returns: Saved PDF path on success, otherwise an explanatory message. """ abstract_id = self._extract_abstract_id(paper_id) if not abstract_id: return f"Invalid SSRN paper id: {paper_id}" pdf_url = self._resolve_pdf_url(abstract_id) if not pdf_url: return ( f"No publicly accessible SSRN PDF URL found for {abstract_id}. " "The paper may require SSRN login or restricted access." ) os.makedirs(save_path, exist_ok=True) output_path = os.path.join(save_path, f"ssrn_{abstract_id}.pdf") try: response = self.session.get(pdf_url, stream=True, timeout=60) response.raise_for_status() content_type = (response.headers.get("content-type") or "").lower() first_chunk = next(response.iter_content(chunk_size=1024), b"") if "pdf" not in content_type and not first_chunk.startswith(b"%PDF"): return ( f"Resolved SSRN URL is not a direct PDF ({pdf_url}). " "This likely requires browser login." )