Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

search_drug_names

Find drug names in the FDA DailyMed database by generic or brand name, manufacturer, and name type with paginated results.

Instructions

Search for drug names using various parameters with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
drug_nameNoGeneric or brand name of drug
name_typeNoSpecify name type
manufacturerNoName of drug manufacturer
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 100, max: 100)

Implementation Reference

  • The core handler implementation for searching drug names, including API request construction and pagination handling.
    async searchDrugNamesAdvanced(params: DrugNameSearchParams = {}): Promise<PaginatedDrugNameResponse> {
      const { page = 1, pageSize = 100, ...searchParams } = params;
      
      validatePaginationParams(page, pageSize, 100);
    
      try {
        const queryParams: any = {
          page,
          pagesize: Math.min(pageSize, 100), // API max is 100
        };
    
        // Add search filters
        if (searchParams.drug_name) queryParams.drug_name = searchParams.drug_name;
        if (searchParams.name_type) queryParams.name_type = searchParams.name_type;
        if (searchParams.manufacturer) queryParams.manufacturer = searchParams.manufacturer;
    
        const response = await this.client.get("/drugnames.json", {
          params: queryParams,
        });
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
          const drugNames = response.data.data.map((item: any) => ({
            drugName: item.drug_name,
            routeOfAdministration: item.route_of_administration,
            activeIngredient: item.active_ingredient,
          }));
    
          // Extract pagination metadata from API response
          const totalResults = response.data.metadata?.total_elements || drugNames.length;
          const totalPages = Math.ceil(totalResults / pageSize);
    
          return {
            data: drugNames,
            pagination: {
              page,
              pageSize,
              totalResults,
              totalPages,
              hasNextPage: page < totalPages,
              hasPreviousPage: page > 1,
            },
          };
  • src/tools.ts:348-360 (registration)
    Tool definition and schema registration for "search_drug_names".
    {
      name: "search_drug_names",
      description: "Search for drug names using various parameters with pagination support",
      inputSchema: {
        type: "object",
        properties: {
          drug_name: {
            type: "string",
            description: "Generic or brand name of drug",
          },
          name_type: {
            type: "string",
            description: "Specify name type",
Behavior2/5

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

With no annotations provided, the description carries the full burden. It mentions 'pagination support', which is useful behavioral context, but lacks details on permissions, rate limits, response format, or error handling. For a search tool with no annotations, this is a significant gap.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste—it states the purpose and key features (parameters, pagination) without redundancy. It is appropriately sized and front-loaded.

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 no annotations and no output schema, the description is minimal but covers the basic purpose and pagination. It lacks details on behavioral traits and output, making it adequate but with clear gaps for a search tool with multiple parameters.

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?

Schema description coverage is 100%, so the schema fully documents all 5 parameters. The description adds no specific parameter semantics beyond implying 'various parameters' exist. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('Search for drug names') and resource ('drug names'), which is specific. However, it doesn't explicitly differentiate from sibling tools like 'get_all_drug_names' or 'search_drugs_by_pharmacologic_class', which would require a 5.

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 mentions 'various parameters' and 'pagination support', which implies usage context, but provides no explicit guidance on when to use this tool versus alternatives like 'get_all_drug_names' or other search tools. There are no when-not or alternative recommendations.

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