Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

search_uniis

Find UNII codes for drugs using parameters like active moiety, drug class, or RxCUI with paginated results.

Instructions

Search for UNII codes using various parameters with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
active_moietyNoActive moiety filter
drug_class_codeNoDrug class code filter
drug_class_coding_systemNoDrug class coding system filter
rxcuiNoRxCUI filter
unii_codeNoSpecific UNII code to search for
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 25, max: 100)

Implementation Reference

  • The actual implementation of the searchUNIIs logic, handling parameter mapping and API request.
    async searchUNIIs(params: UNIISearchParams = {}): Promise<PaginatedUNIIResponse> {
      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.active_moiety) queryParams.active_moiety = searchParams.active_moiety;
        if (searchParams.drug_class_code) queryParams.drug_class_code = searchParams.drug_class_code;
        if (searchParams.drug_class_coding_system) queryParams.drug_class_coding_system = searchParams.drug_class_coding_system;
        if (searchParams.rxcui) queryParams.rxcui = searchParams.rxcui;
        if (searchParams.unii_code) queryParams.unii_code = searchParams.unii_code;
    
        const response = await this.client.get("/uniis.json", {
          params: queryParams,
        });
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
  • src/index.ts:258-275 (registration)
    The tool handler switch-case that extracts parameters and invokes the unii-client search method.
    case "search_uniis":
      const uniiParams: any = {};
      if (args.active_moiety) uniiParams.active_moiety = args.active_moiety as string;
      if (args.drug_class_code) uniiParams.drug_class_code = args.drug_class_code as string;
      if (args.drug_class_coding_system) uniiParams.drug_class_coding_system = args.drug_class_coding_system as string;
      if (args.rxcui) uniiParams.rxcui = args.rxcui as string;
      if (args.unii_code) uniiParams.unii_code = args.unii_code as string;
      if (args.page) uniiParams.page = args.page as number;
      if (args.pageSize) uniiParams.pageSize = args.pageSize as number;
    
      const uniiResults = await this.client.searchUNIIs(uniiParams);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(uniiResults, null, 2),
          },
        ],
  • The tool definition and schema registration for search_uniis.
    {
      name: "search_uniis",
      description: "Search for UNII codes using various parameters with pagination support",
      inputSchema: {
        type: "object",
        properties: {
          active_moiety: {
            type: "string",
            description: "Active moiety filter",
          },
          drug_class_code: {
            type: "string",
            description: "Drug class code filter",
          },
          drug_class_coding_system: {
            type: "string",
            description: "Drug class coding system filter",
          },
          rxcui: {
            type: "string",
            description: "RxCUI filter",
          },
          unii_code: {
            type: "string",
            description: "Specific UNII code to search for",
          },
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 of behavioral disclosure. It mentions 'pagination support', which is useful, but lacks details on authentication needs, rate limits, error handling, or what the search returns (e.g., format, structure). For a search tool with 7 parameters, this leaves significant gaps.

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 front-loads the core purpose ('search for UNII codes') and includes key behavioral detail ('pagination support'), making it appropriately sized and well-structured.

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

Completeness2/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 incomplete for a tool with 7 parameters. It lacks details on authentication, rate limits, error handling, and the return format (e.g., what data fields are included). For a search tool in a complex domain (UNII codes), this leaves the agent under-informed.

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 7 parameters. The description adds no additional parameter semantics beyond implying 'various parameters' and pagination, which are already covered. Baseline 3 is appropriate as 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 UNII codes') and resource ('UNII codes'), making the purpose understandable. It distinguishes from siblings like 'get_all_uniis' by specifying search functionality, though it doesn't explicitly contrast with other search tools like 'search_drug_names' or 'search_rxcuis'.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or how it differs from other search tools (e.g., 'search_drug_names' or 'search_rxcuis'), leaving the agent without contextual direction.

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