Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

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
NameRequiredDescriptionDefault
drugClassCodeYesThe drug class code (e.g., N0000175605 for Kinase Inhibitor) from DailyMed drug classes API
codingSystemNoThe coding system for the drug class code (defaults to 2.16.840.1.113883.6.345 which matches the drug classes API)
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 25, max: 100)

Implementation Reference

  • 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,
        },
  • 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: [

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/RowanErasmus/dailymed-mcp-server'

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