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: [
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions pagination support, which is useful context not in the schema, but doesn't cover other important aspects like rate limits, authentication needs, error handling, or what the response format looks like. For a search tool with no annotations, this leaves significant gaps in understanding its operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded: the first sentence states the core purpose, and the second adds important behavioral context (pagination). Both sentences earn their place, with no redundant or vague phrasing. It could be slightly more structured by explicitly separating purpose from constraints, but it's efficiently written.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search with pagination), no annotations, and no output schema, the description is partially complete. It covers the basic purpose and pagination behavior but lacks details on response format, error conditions, or integration with sibling tools. For a search tool in this context, more guidance on outputs and alternatives would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so parameters are well-documented in the schema itself. The description adds minimal value beyond the schema: it implies the drugClassCode comes from the drug classes API and mentions pagination, but doesn't provide additional syntax, format details, or examples. This meets the baseline for high schema coverage but doesn't enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for drugs using DailyMed drug class codes'. It specifies the verb ('Search'), resource ('drugs'), and data source ('DailyMed drug class codes'). However, it doesn't explicitly differentiate from sibling tools like 'search_drug_classes' or 'get_pharmacologic_class_details', which reduces clarity about its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance: it mentions using drug class codes from the drug classes API and supports pagination. However, it doesn't explain when to use this tool versus alternatives like 'search_drug_classes' or 'get_pharmacologic_class_mappings_for_setid', nor does it specify prerequisites or exclusions. This lack of contextual guidance leaves the agent uncertain about optimal usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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