Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_drug_label_info

Fetch FDA drug label data including indications, warnings, dosage forms, and active ingredients by brand name, generic name, or NDC.

Instructions

Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes.

Returns: dict: Drug label results with indications, warnings, dosage, active ingredients or error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
brand_nameNoBrand name of the drug
generic_nameNoGeneric name of the drug
ndcNoNational Drug Code (NDC)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function (MCP tool) that executes the get_drug_label_info logic. Accepts brand_name, generic_name, or ndc, queries the FDA drug label API endpoint, and returns results.
    @core_mcp.tool()
    def get_drug_label_info(
        brand_name: Annotated[Optional[str], Field(description="Brand name of the drug")] = None,
        generic_name: Annotated[Optional[str], Field(description="Generic name of the drug")] = None,
        ndc: Annotated[Optional[str], Field(description="National Drug Code (NDC)")] = None,
    ) -> dict:
        """Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes.
    
        Returns:
            dict: Drug label results with indications, warnings, dosage, active ingredients or error message.
        """
        if not any([brand_name, generic_name, ndc]):
            return {"error": "At least one of brand_name, generic_name, or ndc must be provided"}
    
        # Use the Drug Label API endpoint
        query_parts = []
        if brand_name:
            query_parts.append(f"openfda.brand_name:{brand_name}")
        if generic_name:
            query_parts.append(f"openfda.generic_name:{generic_name}")
        if ndc:
            query_parts.append(f"openfda.package_ndc:{ndc}")
    
        query = " OR ".join(query_parts)
        if len(query_parts) > 1:
            query = f"({query})"
    
        base_url = "https://api.fda.gov/drug/label.json"
        params = {"search": query, "limit": 5}
    
        try:
            response = requests.get(base_url, params=params)  # type: ignore
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            return {"error": f"Failed to fetch FDA drug label data: {e!s}"}
  • Input schema/type annotations for the tool: three optional string parameters (brand_name, generic_name, ndc) with Pydantic field descriptions.
    def get_drug_label_info(
        brand_name: Annotated[Optional[str], Field(description="Brand name of the drug")] = None,
        generic_name: Annotated[Optional[str], Field(description="Generic name of the drug")] = None,
        ndc: Annotated[Optional[str], Field(description="National Drug Code (NDC)")] = None,
    ) -> dict:
        """Get comprehensive drug labeling information from FDA. Includes active ingredients, dosage forms, administration routes.
    
        Returns:
            dict: Drug label results with indications, warnings, dosage, active ingredients or error message.
        """
  • Tool registration via @core_mcp.tool() decorator on the get_drug_label_info function. core_mcp is a FastMCP instance defined in src/biocontext_kb/core/_server.py.
    from biocontext_kb.core._server import core_mcp
  • Re-export of get_drug_label_info from the openfda package's __init__.py.
    from ._get_drug_info import get_drug_by_application_number, get_drug_label_info
    from ._search_drugs import search_drugs_fda
  • The FastMCP server instance ('core_mcp') used to register the tool via the @core_mcp.tool() decorator.
    from fastmcp import FastMCP
    
    core_mcp = FastMCP(  # type: ignore
        "BC",
        instructions="Provides access to biomedical knowledge bases.",
    )
Behavior2/5

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

With no annotations, the description carries full burden for behavioral disclosure. It mentions the return format (dict with results or error message) but does not address authentication, rate limits, or what happens when parameters are all missing. The description is too sparse for a tool with no annotation support.

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 very concise, with two sentences covering purpose and included data, plus a separate line for return format. It is front-loaded and contains no redundant or extraneous information.

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 that an output schema exists (so return format is partially covered), the description is fairly complete. It specifies the source, coverage, and return type. However, it could mention that at least one parameter is typically required for meaningful results, even though all are optional in schema.

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 does not add extra meaning beyond the schema's parameter descriptions; it focuses on output content. No enhancement is needed, but also no degradation.

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 retrieves comprehensive drug labeling information from the FDA, with specific examples of included data (active ingredients, dosage forms, administration routes). This is a specific verb+resource combination that distinguishes it from sibling tools that focus on other drug-related queries.

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 its siblings (e.g., bc_search_drugs_fda, bc_get_drug_by_application_number). It does not state prerequisites, when-not-to-use, or alternatives, leaving the agent without context for selection.

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/biocontext-ai/knowledgebase-mcp'

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