search_drugs_by_pharmacologic_class
Find drugs by pharmacologic class using DailyMed drug class codes to retrieve medications with specific therapeutic mechanisms.
Instructions
Search for drugs using DailyMed drug class codes (from the drug classes API). Supports pagination for large result sets.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| drugClassCode | Yes | The drug class code (e.g., N0000175605 for Kinase Inhibitor) from DailyMed drug classes API | |
| codingSystem | No | The coding system for the drug class code (defaults to 2.16.840.1.113883.6.345 which matches the drug classes API) | |
| page | No | Page number for pagination (1-based, default: 1) | |
| pageSize | No | Number of results per page (default: 25, max: 100) |
Implementation Reference
- src/clients/drug-class-client.ts:98-119 (handler)The actual implementation of the tool logic, fetching data from DailyMed API.
async searchDrugsByPharmacologicClass(drugClassCode: string, codingSystem?: string, page: number = 1, pageSize: number = 25): Promise<PaginatedSPLResponse> { if (!drugClassCode || typeof drugClassCode !== "string") { throw new Error("Valid drug class code is required"); } validatePaginationParams(page, pageSize, 100); try { const params: any = { drug_class_code: drugClassCode, drug_class_coding_system: codingSystem || "2.16.840.1.113883.6.345", pagesize: pageSize, page: page }; const response = await this.client.get("/spls.json", { params: params, }); if ( response.data && response.data.data && - src/tools.ts:595-612 (registration)Registration of the tool with its schema definition.
name: "search_drugs_by_pharmacologic_class", description: "Search for drugs using DailyMed drug class codes (from the drug classes API). Supports pagination for large result sets.", inputSchema: { type: "object", properties: { drugClassCode: { type: "string", description: "The drug class code (e.g., N0000175605 for Kinase Inhibitor) from DailyMed drug classes API", }, codingSystem: { type: "string", description: "The coding system for the drug class code (defaults to 2.16.840.1.113883.6.345 which matches the drug classes API)", }, page: { type: "number", description: "Page number for pagination (1-based, default: 1)", minimum: 1, }, - src/index.ts:448-456 (handler)The MCP handler block that invokes the client method for this tool.
case "search_drugs_by_pharmacologic_class": const drugsByClass = await this.client.searchDrugsByPharmacologicClass( args.drugClassCode as string, args.codingSystem as string | undefined, args.page as number, args.pageSize as number, ); return { content: [