get_download_links
Retrieve ZIP and PDF download links for specific drug documents from the FDA DailyMed database using the drug's SET ID.
Instructions
Get download links for ZIP and PDF files of a specific drug by its SET ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| setId | Yes | The SET ID of the drug to get download links for |
Implementation Reference
- src/clients/spl-client.ts:392-406 (handler)Implementation of the download link generation for ZIP and PDF files in SPLClient.
async downloadSPLZip(setId: string): Promise<string> { if (!setId || typeof setId !== "string") { throw new Error("Valid SET ID is required"); } return `${this.baseURL}/spls/${setId}.zip`; } async downloadSPLPdf(setId: string): Promise<string> { if (!setId || typeof setId !== "string") { throw new Error("Valid SET ID is required"); } return `${this.baseURL}/spls/${setId}.pdf`; } - src/index.ts:206-227 (registration)Tool handler registration for 'get_download_links' in the DailyMed server.
case "get_download_links": const zipLink = await this.client.downloadSPLZip( args.setId as string, ); const pdfLink = await this.client.downloadSPLPdf( args.setId as string, ); return { content: [ { type: "text", text: JSON.stringify( { zipDownload: zipLink, pdfDownload: pdfLink, }, null, 2, ), }, ], }; - src/tools.ts:204-217 (schema)Tool schema definition for 'get_download_links'.
name: "get_download_links", description: "Get download links for ZIP and PDF files of a specific drug by its SET ID", inputSchema: { type: "object", properties: { setId: { type: "string", description: "The SET ID of the drug to get download links for", }, }, required: ["setId"], }, },