Skip to main content
Glama
RowanErasmus

DailyMed MCP Server

by RowanErasmus

search_spls

Search for FDA Structured Product Labels (SPLs) by drug name or using advanced parameters like NDC codes, RxNorm identifiers, and manufacturer details to retrieve comprehensive drug labeling information.

Instructions

Search for Structured Product Labels (SPLs) using either simple drug name search or advanced DailyMed API parameters. When using simple query, searches for drugs first then finds related SPLs. When using advanced parameters, queries DailyMed SPLs API directly. Supports pagination for large result sets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSimple search query for drug name or active ingredient (use this OR advanced parameters, not both)
application_numberNoNDA number (e.g., 'NDA012345')
boxed_warningNoFilter by presence of boxed warning
dea_schedule_codeNoDEA schedule code (e.g., 'none', 'C48672')
doctypeNoFDA document type
drug_class_codeNoPharmacologic drug class code
drug_class_coding_systemNoDrug class coding system (default: '2.16.840.1.113883.3.26.1.5')
drug_nameNoGeneric or brand drug name for direct API search
name_typeNoName type filter
labelerNoLabeler name
manufacturerNoManufacturer name
marketing_category_codeNoFDA marketing category code
ndcNoNational Drug Code
published_dateNoPublished date in YYYY-MM-DD format
published_date_comparisonNoDate comparison operator
rxcuiNoRxNorm Concept Unique Identifier
setidNoLabel Set ID
unii_codeNoUnique Ingredient Identifier
pageNoPage number for pagination (1-based, default: 1)
pageSizeNoNumber of results per page (default: 25, max: 100 for advanced queries, max: 200 for simple queries)

Implementation Reference

  • The main handler function for the `search_spls` tool. It delegates to either `searchSPLsByDrugName` or `searchSPLsAdvanced` based on the parameters provided.
    async searchSPLs(params: AdvancedSPLSearchParams): Promise<PaginatedSPLResponse> {
      const { page = 1, pageSize = 25, query, ...advancedParams } = params;
    
      validatePaginationParams(page, pageSize);
    
      // Check if this is a simple query or advanced search
      const hasAdvancedParams = Object.values(advancedParams).some(value => value !== undefined);
      const isSimpleQuery = query && !hasAdvancedParams;
    
      if (!isSimpleQuery && !hasAdvancedParams) {
        throw new Error("Either 'query' or at least one advanced parameter is required");
      }
    
      try {
        if (isSimpleQuery) {
          // Use the existing drug name search approach
          return await this.searchSPLsByDrugName(query!, page, pageSize);
        } else {
          // Use advanced DailyMed SPLs API search
          return await this.searchSPLsAdvanced(params);
        }
      } catch (error) {
        throw new Error(
          `Failed to search SPLs: ${error instanceof Error ? error.message : "Unknown error"}`,
        );
      }
    }
  • src/tools.ts:218-222 (registration)
    Tool registration for `search_spls`. Defines the input schema and description.
    {
      name: "search_spls",
      description: "Search for Structured Product Labels (SPLs) using either simple drug name search or advanced DailyMed API parameters. When using simple query, searches for drugs first then finds related SPLs. When using advanced parameters, queries DailyMed SPLs API directly. Supports pagination for large result sets.",
      inputSchema: {
        type: "object",
Behavior4/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 effectively describes key behaviors: the two search modes (simple vs. advanced), the indirect drug-first approach for simple queries, and pagination support for large result sets. It lacks details on rate limits, error handling, or response format, but covers essential operational traits adequately.

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 front-loaded with the core purpose, followed by concise explanations of the two search modes and pagination support. Each sentence earns its place by adding critical information without redundancy, making it efficiently structured and appropriately sized for the tool's complexity.

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

Completeness4/5

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

Given the high parameter count (20), no annotations, and no output schema, the description does well by explaining search modes and pagination. However, it lacks details on response format, error conditions, or authentication needs, which are important for a search tool with many parameters. It is mostly complete but has minor gaps.

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 already documents all 20 parameters thoroughly. The description adds marginal value by explaining the high-level distinction between simple (using 'query') and advanced (using other parameters) modes, but does not provide additional semantic context beyond what the schema offers, aligning with the baseline for high coverage.

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

Purpose5/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 Structured Product Labels (SPLs)' using either simple drug name search or advanced DailyMed API parameters. It specifies the resource (SPLs) and distinguishes between two search modes, making it highly specific and differentiated from sibling tools that focus on individual data types like application numbers or drug names.

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

Usage Guidelines4/5

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

The description provides clear context on when to use different modes: 'When using simple query, searches for drugs first then finds related SPLs. When using advanced parameters, queries DailyMed SPLs API directly.' It implies usage scenarios but does not explicitly state when to choose this tool over sibling search tools (e.g., search_drug_names) or list exclusions, which prevents a perfect score.

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