Skip to main content
Glama

openfda_approval_searcher

Verify FDA drug approval details by searching the Drugs@FDA database. Retrieve application numbers, drug names, formulations, marketing status, and approval dates to confirm drug status and history.

Instructions

Search FDA drug approval records from Drugs@FDA database.

⚠️ PREREQUISITE: Use the 'think' tool FIRST to plan your research strategy!

Returns information about:
- Application numbers and sponsors
- Brand and generic names
- Product formulations and strengths
- Marketing status and approval dates
- Submission history

Useful for verifying if a drug is FDA-approved and when.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoOptional OpenFDA API key (overrides OPENFDA_API_KEY env var)
application_numberNoNDA or BLA application number
approval_yearNoYear of approval (YYYY format)
drugNoDrug name (brand or generic) to search for
limitNoMaximum number of results
pageNoPage number (1-based)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler function for 'openfda_approval_searcher'. Registers the tool via @mcp_app.tool(), defines input schema via Pydantic Annotated fields, and implements logic by delegating to the openfda helper module.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_approval_searcher")
    async def openfda_approval_searcher(
        drug: Annotated[
            str | None,
            Field(description="Drug name (brand or generic) to search for"),
        ] = None,
        application_number: Annotated[
            str | None,
            Field(description="NDA or BLA application number"),
        ] = None,
        approval_year: Annotated[
            str | None,
            Field(description="Year of approval (YYYY format)"),
        ] = None,
        limit: Annotated[
            int,
            Field(description="Maximum number of results", ge=1, le=100),
        ] = 25,
        page: Annotated[
            int,
            Field(description="Page number (1-based)", ge=1),
        ] = 1,
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
        """Search FDA drug approval records from Drugs@FDA database.
    
        ⚠️ PREREQUISITE: Use the 'think' tool FIRST to plan your research strategy!
    
        Returns information about:
        - Application numbers and sponsors
        - Brand and generic names
        - Product formulations and strengths
        - Marketing status and approval dates
        - Submission history
    
        Useful for verifying if a drug is FDA-approved and when.
        """
        from biomcp.openfda import search_drug_approvals
    
        skip = (page - 1) * limit
        return await search_drug_approvals(
            drug=drug,
            application_number=application_number,
            approval_year=approval_year,
            limit=limit,
            skip=skip,
            api_key=api_key,
        )
  • The supporting helper function that performs the actual OpenFDA API search for drug approvals, constructs search queries, handles pagination, formats results, and includes supporting formatting functions.
    async def search_drug_approvals(
        drug: str | None = None,
        application_number: str | None = None,
        approval_year: str | None = None,
        limit: int = OPENFDA_DEFAULT_LIMIT,
        skip: int = 0,
        api_key: str | None = None,
    ) -> str:
        """
        Search FDA drug approval records from Drugs@FDA.
    
        Args:
            drug: Drug name (brand or generic) to search for
            application_number: NDA or BLA application number
            approval_year: Year of approval (YYYY format)
            limit: Maximum number of results to return
            skip: Number of results to skip (for pagination)
    
            api_key: Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)
    
        Returns:
            Formatted string with drug approval information
        """
        # Build search query
        search_params = {}
    
        if drug:
            # Search both brand and generic names
            search_params["search"] = (
                f'(openfda.brand_name:"{drug}" OR '
                f'openfda.generic_name:"{drug}" OR '
                f'openfda.substance_name:"{drug}")'
            )
        elif application_number:
            search_params["search"] = f'application_number:"{application_number}"'
        elif approval_year:
            # Search for approvals in a specific year
            search_params["search"] = (
                f"products.marketing_status_date:[{approval_year}-01-01 TO {approval_year}-12-31]"
            )
    
        # Add pagination
        search_params["limit"] = str(min(limit, 100))
        search_params["skip"] = str(skip)
    
        # Sort by submission date (most recent first)
        search_params["sort"] = "submissions.submission_status_date:desc"
    
        # Make the request
        response, error = await make_openfda_request(
            OPENFDA_DRUGSFDA_URL, search_params, "openfda_approvals", api_key
        )
    
        if error:
            return f"⚠️ Error searching drug approvals: {error}"
    
        if not response or not response.get("results"):
            return "No drug approval records found matching your criteria."
    
        # Format the results
        results = response["results"]
        total = (
            response.get("meta", {}).get("results", {}).get("total", len(results))
        )
    
        output = ["## FDA Drug Approval Records\n"]
    
        if drug:
            output.append(f"**Drug**: {drug}")
        if application_number:
            output.append(f"**Application**: {application_number}")
        if approval_year:
            output.append(f"**Approval Year**: {approval_year}")
    
        output.append(
            f"**Total Records Found**: {format_count(total, 'record')}\n"
        )
    
        # Show results
        output.append(f"### Results (showing {len(results)} of {total}):\n")
    
        for i, record in enumerate(results, 1):
            output.extend(_format_approval_summary(record, i))
    
        output.append(f"\n{OPENFDA_DISCLAIMER}")
    
        return "\n".join(output)
  • Tool registration via the @mcp_app.tool() decorator applied to the handler function.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_approval_searcher")
    async def openfda_approval_searcher(
        drug: Annotated[
            str | None,
            Field(description="Drug name (brand or generic) to search for"),
        ] = None,
        application_number: Annotated[
            str | None,
            Field(description="NDA or BLA application number"),
        ] = None,
        approval_year: Annotated[
            str | None,
            Field(description="Year of approval (YYYY format)"),
        ] = None,
        limit: Annotated[
            int,
            Field(description="Maximum number of results", ge=1, le=100),
        ] = 25,
        page: Annotated[
            int,
            Field(description="Page number (1-based)", ge=1),
        ] = 1,
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
        """Search FDA drug approval records from Drugs@FDA database.
    
        ⚠️ PREREQUISITE: Use the 'think' tool FIRST to plan your research strategy!
    
        Returns information about:
        - Application numbers and sponsors
        - Brand and generic names
        - Product formulations and strengths
        - Marketing status and approval dates
        - Submission history
    
        Useful for verifying if a drug is FDA-approved and when.
        """
        from biomcp.openfda import search_drug_approvals
    
        skip = (page - 1) * limit
        return await search_drug_approvals(
            drug=drug,
            application_number=application_number,
            approval_year=approval_year,
            limit=limit,
            skip=skip,
            api_key=api_key,
        )
  • Input schema definition via function parameters with Pydantic annotations.
        drug: Annotated[
            str | None,
            Field(description="Drug name (brand or generic) to search for"),
        ] = None,
        application_number: Annotated[
            str | None,
            Field(description="NDA or BLA application number"),
        ] = None,
        approval_year: Annotated[
            str | None,
            Field(description="Year of approval (YYYY format)"),
        ] = None,
        limit: Annotated[
            int,
            Field(description="Maximum number of results", ge=1, le=100),
        ] = 25,
        page: Annotated[
            int,
            Field(description="Page number (1-based)", ge=1),
        ] = 1,
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses the tool's search behavior (returns multiple types of drug approval information), mentions the prerequisite 'think' tool requirement, and indicates it's for verification purposes. However, it doesn't mention rate limits, authentication needs (though api_key parameter suggests optional auth), or pagination behavior (implied by page/limit parameters but not explicitly described).

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 well-structured and front-loaded with the core purpose. Every sentence earns its place: first states what it does, then prerequisite warning, then what information it returns, and finally when to use it. No wasted words, and the warning emoji draws appropriate attention to the important prerequisite.

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 tool has an output schema (so return values are documented elsewhere), 6 parameters with 100% schema coverage, and no annotations, the description is reasonably complete. It covers purpose, prerequisite, returned information types, and use case. However, for a search tool with multiple parameters, it could better explain how searches work (e.g., are parameters AND/OR combined, what happens when multiple are provided).

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 baseline is 3. The description doesn't add significant parameter semantics beyond what's in the schema - it mentions searching by 'drug name' and returns 'application numbers' which map to parameters, but doesn't explain parameter interactions, search logic, or how multiple parameters combine. The description focuses on what the tool does rather than how to use the parameters.

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 with specific verb ('Search') and resource ('FDA drug approval records from Drugs@FDA database'). It distinguishes itself from sibling tools like 'openfda_approval_getter' by being a search tool rather than a getter, and explicitly mentions what information it returns (application numbers, brand/generic names, formulations, etc.).

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

Usage Guidelines5/5

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

The description provides explicit usage guidance with a prerequisite warning ('⚠️ PREREQUISITE: Use the 'think' tool FIRST to plan your research strategy!') and states when to use it ('Useful for verifying if a drug is FDA-approved and when'). It differentiates from other FDA tools by specifying it searches approval records specifically, not adverse events, labels, or other data types.

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

Related 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/genomoncology/biomcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server