bc_get_drug_by_application_number
Retrieve FDA-approved drug details using application numbers (NDA/ANDA/BLA format) to access verified information about products, sponsors, and application data.
Instructions
Get detailed information about an FDA-approved drug by application number. Format: NDA/ANDA/BLA followed by 6 digits.
Returns: dict: FDA drug results with application details, products, sponsor information or error message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| application_number | Yes | FDA application number (e.g., 'NDA021436', 'ANDA123456', 'BLA761234') |
Implementation Reference
- The handler function for the tool, decorated with @core_mcp.tool(). Fetches drug details from FDA API using the application number. Tool name becomes 'bc_get_drug_by_application_number' due to 'bc' prefix when core_mcp is imported into the main server.@core_mcp.tool() def get_drug_by_application_number( application_number: Annotated[ str, Field(description="FDA application number (e.g., 'NDA021436', 'ANDA123456', 'BLA761234')") ], ) -> dict: """Get detailed information about an FDA-approved drug by application number. Format: NDA/ANDA/BLA followed by 6 digits. Returns: dict: FDA drug results with application details, products, sponsor information or error message. """ # Validate application number format if not application_number or len(application_number) < 9: return {"error": "Application number must be provided and follow the format NDA/ANDA/BLA followed by 6 digits"} # Build the search query query = f"application_number:{application_number}" base_url = "https://api.fda.gov/drug/drugsfda.json" params = {"search": query, "limit": 1} 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 data: {e!s}"}
- Pydantic schema definition for the input parameter 'application_number' using Annotated and Field.application_number: Annotated[ str, Field(description="FDA application number (e.g., 'NDA021436', 'ANDA123456', 'BLA761234')") ],
- src/biocontext_kb/app.py:35-39 (registration)Registers the core_mcp server (containing the tool) into the main mcp_app with prefix 'bc' (slugify('BC')), resulting in tool name 'bc_get_drug_by_application_number'.for mcp in [core_mcp, *(await get_openapi_mcps())]: await mcp_app.import_server( mcp, slugify(mcp.name), )
- src/biocontext_kb/core/_server.py:3-6 (registration)Defines the core_mcp FastMCP instance named 'BC', into which tools are registered via @core_mcp.tool() decorators.core_mcp = FastMCP( # type: ignore "BC", instructions="Provides access to biomedical knowledge bases.", )