Skip to main content
Glama
biocontext-ai

BioContextAI Knowledgebase MCP

Official

bc_get_drug_label_info

Retrieve FDA drug labeling information including active ingredients, dosage forms, administration routes, indications, warnings, and dosage details.

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

  • Handler function for the 'bc_get_drug_label_info' tool. It queries the FDA OpenFDA drug label API using brand name, generic name, or NDC code to retrieve comprehensive drug labeling information including active ingredients, indications, warnings, and dosage details.
    @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}"}
  • The core_mcp FastMCP server instance named 'BC' where tools like 'bc_get_drug_label_info' are registered via decorators. The 'bc_' prefix comes from the server name.
    core_mcp = FastMCP(  # type: ignore
        "BC",
        instructions="Provides access to biomedical knowledge bases.",
    )
  • Imports the core_mcp server (containing the tool) into the main BioContextAI MCP app.
    for mcp in [core_mcp, *(await get_openapi_mcps())]:
        await mcp_app.import_server(
            mcp,
            slugify(mcp.name),
        )
  • Input schema defined inline with Pydantic Field descriptions for the tool parameters.
    @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}"}
  • Imports the get_drug_label_info function into the openfda module namespace.
    from ._count_drugs import count_drugs_by_field, get_drug_statistics
    from ._get_drug_info import get_drug_by_application_number, get_drug_label_info
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the return format ('dict: Drug label results...') which is helpful, but doesn't describe important behavioral aspects like whether this is a read-only operation, potential rate limits, authentication requirements, error conditions beyond 'error message', or what happens when multiple parameters are provided. The description is insufficient for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: one stating the purpose and scope, another describing the return format. It's appropriately sized for this type of lookup tool. The information is front-loaded with the core purpose first. There's minimal wasted language.

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

Completeness3/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 (implied by 'Has output schema: true'), the description doesn't need to fully explain return values. However, for a drug information tool with no annotations and multiple sibling tools, the description should provide more context about when to use it versus alternatives. The description is adequate but has clear gaps in usage guidance and behavioral transparency.

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%, with all three parameters clearly documented in the schema. The description doesn't add any parameter-specific information beyond what's in the schema. It doesn't explain parameter relationships (e.g., whether to use brand_name vs generic_name vs ndc, or what happens when multiple are provided). The baseline of 3 is appropriate given 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 tool's purpose: 'Get comprehensive drug labeling information from FDA' with specific content details ('active ingredients, dosage forms, administration routes'). It distinguishes from most siblings by focusing on FDA drug labels rather than other biomedical data types, though it doesn't explicitly differentiate from 'bc_search_drugs_fda' which might have some overlap.

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 about when to use this tool versus alternatives. The description doesn't mention when this tool is appropriate versus other drug-related tools like 'bc_search_drugs_fda', 'bc_get_drug_by_application_number', or 'bc_get_generic_equivalents'. There's no context about prerequisites, limitations, or typical use cases.

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