Skip to main content
Glama

download_paper

Download PDF files of academic papers from multiple platforms including arXiv, PubMed, and Sci-Hub by providing paper IDs and platform information.

Instructions

Download PDF file of an academic paper

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paperIdYesPaper ID (e.g., arXiv ID, DOI for Sci-Hub)
platformYesPlatform where the paper is from
savePathNoDirectory to save the PDF file

Implementation Reference

  • Handler function for the 'download_paper' tool. Parses arguments, selects the appropriate platform searcher, validates download capability, calls downloadPdf on the searcher, and returns the saved file path.
    case 'download_paper': { const { paperId, platform, savePath } = args; const resolvedSavePath = savePath || './downloads'; const searcher = (searchers as any)[platform]; if (!searcher) { throw new Error(`Unsupported platform for download: ${platform}`); } if (!searcher.getCapabilities().download) { throw new Error(`Platform ${platform} does not support PDF download`); } const filePath = await searcher.downloadPdf(paperId, { savePath: resolvedSavePath }); return jsonTextResponse(`PDF downloaded successfully to: ${filePath}`); }
  • Zod schema defining input validation for download_paper tool: paperId (required), platform (enum), savePath (optional). Used in parseToolArgs.
    export const DownloadPaperSchema = z .object({ paperId: z.string().min(1), platform: z.enum(['arxiv', 'biorxiv', 'medrxiv', 'semantic', 'iacr', 'scihub', 'springer', 'wiley']), savePath: z.string().optional() }) .strip();
  • MCP tool registration in TOOLS array, including name, description, and inputSchema matching the Zod schema.
    { name: 'download_paper', description: 'Download PDF file of an academic paper', inputSchema: { type: 'object', properties: { paperId: { type: 'string', description: 'Paper ID (e.g., arXiv ID, DOI for Sci-Hub)' }, platform: { type: 'string', enum: ['arxiv', 'biorxiv', 'medrxiv', 'semantic', 'iacr', 'scihub', 'springer', 'wiley'], description: 'Platform where the paper is from' }, savePath: { type: 'string', description: 'Directory to save the PDF file' } }, required: ['paperId', 'platform'] } },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dianel555/paper-search-mcp-nodejs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server