Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

search_application_numbers

Find FDA drug application numbers (NDA, ANDA) by specific parameters like marketing category or set ID with paginated results for efficient searching.

Instructions

Search for FDA application numbers (NDA, ANDA, etc.) using various parameters with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_numberNoSpecific drug application number (e.g., NDA022527)
marketing_category_codeNoMarketing category code for a drug
setidNoSet ID of a drug label
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 100, max: 100)

Implementation Reference

  • The core logic for searching application numbers, interacting with the DailyMed API.
    async searchApplicationNumbersAdvanced(params: ApplicationNumberSearchParams = {}): Promise<PaginatedApplicationNumberResponse> {
      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.application_number) queryParams.application_number = searchParams.application_number;
        if (searchParams.marketing_category_code) queryParams.marketing_category_code = searchParams.marketing_category_code;
        if (searchParams.setid) queryParams.setid = searchParams.setid;
    
        const response = await this.client.get("/applicationnumbers.json", {
          params: queryParams,
        });
    
        if (
          response.data &&
          response.data.data &&
          Array.isArray(response.data.data)
        ) {
          const applicationNumbers = response.data.data.map((item: any) => ({
            applicationNumber: item.application_number || item.applicationNumber,
            applicationNumberType: item.application_number_type || item.applicationNumberType,
            marketingCategoryCode: item.marketing_category_code || item.marketingCategoryCode,
            setId: item.setid,
          }));
    
          // Extract pagination metadata from API response
          const totalResults = response.data.metadata?.total_elements || applicationNumbers.length;
          const totalPages = Math.ceil(totalResults / pageSize);
    
          return {
            data: applicationNumbers,
            pagination: {
              page,
              pageSize,
              totalResults,
              totalPages,
              hasNextPage: page < totalPages,
              hasPreviousPage: page > 1,
            },
          };
        } else {
          throw new Error("Unexpected response structure for application number search");
        }
      } catch (error) {
        throw new Error(
          `Failed to search application numbers: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
  • src/tools.ts:422-445 (registration)
    Tool definition and schema registration for search_application_numbers.
    name: "search_application_numbers",
    description: "Search for FDA application numbers (NDA, ANDA, etc.) using various parameters with pagination support",
    inputSchema: {
      type: "object",
      properties: {
        application_number: {
          type: "string",
          description: "Specific drug application number (e.g., NDA022527)",
        },
        marketing_category_code: {
          type: "string",
          description: "Marketing category code for a drug",
        },
        setid: {
          type: "string",
          description: "Set ID of a drug label",
        },
        page: {
          type: "number",
          description: "Page number for pagination (1-based, default: 1)",
          minimum: 1,
        },
        pageSize: {
          type: "number",
  • The request handler in the main server loop that maps the MCP tool call to the client implementation.
    case "search_application_numbers":
      const appNumParams: any = {};
      if (args.application_number)
        appNumParams.application_number =
          args.application_number as string;
      if (args.marketing_category_code)
        appNumParams.marketing_category_code =
          args.marketing_category_code as string;
      if (args.setid) appNumParams.setid = args.setid as string;
    
      // Add pagination parameters
      if (args.page) appNumParams.page = args.page as number;
      if (args.pageSize) appNumParams.pageSize = args.pageSize as number;
    
      const appNumResults = await this.client.searchApplicationNumbersAdvanced(appNumParams);
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 doesn't describe other important behaviors such as authentication requirements, rate limits, error handling, or what the response format looks like (since there's no output schema). For a search tool with 5 parameters, this leaves significant gaps in understanding how the tool behaves.

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 that clearly communicates the core functionality. It's appropriately sized for the tool's complexity, with no redundant information or unnecessary elaboration. The structure is front-loaded with the main purpose.

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 the tool's complexity (5 parameters, search functionality), lack of annotations, and absence of an output schema, the description is insufficiently complete. It doesn't explain what results look like, how pagination works in practice, or important behavioral constraints. For a search tool with multiple filtering options, users need more context about response format and limitations.

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, providing clear documentation for all 5 parameters. The description adds minimal value beyond the schema by mentioning 'various parameters' and 'pagination support' without providing additional semantic context. This meets the baseline score of 3 when schema coverage is high.

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 as searching for FDA application numbers with specific parameters and pagination support. It distinguishes itself from sibling tools like 'get_all_application_numbers' by emphasizing search functionality rather than retrieval of all data. However, it doesn't explicitly differentiate from other search tools like 'search_drug_names' or 'search_spls' beyond the resource type.

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

Usage Guidelines3/5

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

The description implies usage for searching FDA application numbers with various parameters, suggesting it should be used when specific filtering is needed. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_all_application_numbers' (for unfiltered lists) or other search tools for different resources. No exclusion criteria or prerequisites are mentioned.

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