Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

search_rxcuis

Find RxCUI codes for drug concepts using drug names, identifiers, or term types to map medications within the DailyMed FDA database.

Instructions

Search for RxCUI codes using various parameters with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rxstringNoRxString value of an RxConcept (drug name/description)
rxcuiNoSpecific RxCUI identifier to search for
rxttyNoTerm Type of RxConcept
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 25, max: 100)

Implementation Reference

  • The handler implementation for `searchRxCUIs` in the `RxNormClient` class. It manages API parameters, executes the request, and transforms the response structure.
    async searchRxCUIs(params: RxCUISearchParams = {}): Promise<PaginatedRxCUIResponse> {
      const { page = 1, pageSize = 25, ...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.rxstring) queryParams.rxstring = searchParams.rxstring;
        if (searchParams.rxcui) queryParams.rxcui = searchParams.rxcui;
        if (searchParams.rxtty) queryParams.rxtty = searchParams.rxtty;
    
        const response = await this.client.get("/rxcuis.json", {
          params: queryParams,
        });
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
          const rxcuis = response.data.data.map((item: any) => ({
            rxcui: item.rxcui,
            drugName: item.rxstring || item.drug_name || item.drugName,
            termType: item.rxtty,
          }));
    
          // Extract pagination metadata from API response
          const totalResults = response.data.metadata?.total_elements || rxcuis.length;
          const totalPages = Math.ceil(totalResults / pageSize);
    
          return {
            data: rxcuis,
            pagination: {
              page,
              pageSize,
              totalResults,
              totalPages,
              hasNextPage: page < totalPages,
              hasPreviousPage: page > 1,
            },
          };
        } else {
          throw new Error("Unexpected response structure for RxCUI search");
        }
      } catch (error) {
        throw new Error(
          `Failed to search RxCUIs: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
  • Tool definition and input schema for `search_rxcuis`.
    {
      name: "search_rxcuis",
      description: "Search for RxCUI codes using various parameters with pagination support",
      inputSchema: {
        type: "object",
        properties: {
          rxstring: {
            type: "string",
            description: "RxString value of an RxConcept (drug name/description)",
          },
          rxcui: {
            type: "string",
            description: "Specific RxCUI identifier to search for",
          },
          rxtty: {
            type: "string",
            description: "Term Type of RxConcept",
            enum: ["PSN", "SBD", "SCD", "BPCK", "GPCK", "SY"],
          },
          page: {
            type: "number",
            description: "Page number for pagination (1-based, default: 1)",
            minimum: 1,
          },
          pageSize: {
            type: "number",
            description: "Number of results per page (default: 25, max: 100)",
            minimum: 1,
            maximum: 100,
          },
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'pagination support,' which is useful, but lacks details on rate limits, authentication needs, error handling, or response format. For a search tool with no annotation coverage, this leaves significant gaps in understanding its 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 a single, efficient sentence that front-loads key information: search functionality and pagination. It avoids redundancy and waste, though it could be slightly more structured by listing key parameters or use cases.

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 complexity (5 parameters, no annotations, no output schema), the description is moderately complete. It covers the core purpose and pagination but lacks details on output format, error conditions, and usage context. Without an output schema, the description should ideally hint at return values, but it does not.

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 input schema fully documents all parameters. The description adds minimal value beyond the schema by implying parameter flexibility ('various parameters') and pagination, but does not explain interactions between parameters or provide examples. Baseline 3 is appropriate as the schema handles most documentation.

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 RxCUI codes using various parameters with pagination support.' It specifies the verb ('search'), resource ('RxCUI codes'), and scope ('various parameters with pagination'). However, it does not explicitly differentiate from sibling tools like 'get_all_rxcuis' or 'search_drug_names,' which might have overlapping functionality.

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 no guidance on when to use this tool versus alternatives. It mentions 'various parameters' but does not specify use cases, prerequisites, or exclusions. Sibling tools like 'get_all_rxcuis' or other search tools exist, but no comparison or context is given.

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