Skip to main content
Glama

openfda_recall_getter

Retrieve comprehensive FDA drug recall details, including product description, reason, distribution pattern, quantity, firm actions, and event timeline, using a specific recall number.

Instructions

Get detailed FDA drug recall information for a specific recall.

Returns complete recall details including:
- Full product description and code information
- Complete reason for recall
- Distribution pattern and locations
- Quantity of product recalled
- Firm information and actions taken
- Timeline of recall events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoOptional OpenFDA API key (overrides OPENFDA_API_KEY env var)
recall_numberYesFDA recall number

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool definition including handler function, input schema via Pydantic Annotated Fields, and @mcp_app.tool() registration decorator. Delegates to openfda.get_drug_recall for core logic.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_recall_getter")
    async def openfda_recall_getter(
        recall_number: Annotated[
            str,
            Field(description="FDA recall number"),
        ],
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
        """Get detailed FDA drug recall information for a specific recall.
    
        Returns complete recall details including:
        - Full product description and code information
        - Complete reason for recall
        - Distribution pattern and locations
        - Quantity of product recalled
        - Firm information and actions taken
        - Timeline of recall events
        """
        from biomcp.openfda import get_drug_recall
    
        return await get_drug_recall(recall_number, api_key=api_key)
  • Core helper function that performs the OpenFDA API request for a specific drug recall number, processes the response, and formats the detailed output using helper formatting functions.
    async def get_drug_recall(
        recall_number: str,
        api_key: str | None = None,
    ) -> str:
        """
        Get detailed drug recall information for a specific recall.
    
        Args:
            recall_number: FDA recall number
    
            api_key: Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)
    
        Returns:
            Formatted string with detailed recall information
        """
        # Search for the specific recall
        search_params = {"search": f'recall_number:"{recall_number}"', "limit": 1}
    
        response, error = await make_openfda_request(
            OPENFDA_DRUG_ENFORCEMENT_URL, search_params, "openfda_recalls", api_key
        )
    
        if error:
            return f"⚠️ Error retrieving drug recall: {error}"
    
        if not response or not response.get("results"):
            return f"No recall record found for {recall_number}"
    
        recall = response["results"][0]
    
        # Format detailed recall information
        output = [f"## Drug Recall Details: {recall_number}\n"]
    
        # Basic information
        output.extend(_format_recall_header(recall))
    
        # Reason and details
        output.extend(_format_recall_details(recall))
    
        # Distribution information
        output.extend(_format_distribution_info(recall))
    
        # OpenFDA metadata
        if openfda := recall.get("openfda"):
            output.extend(_format_recall_openfda(openfda))
    
        output.append(f"\n{OPENFDA_DISCLAIMER}")
    
        return "\n".join(output)
  • The @mcp_app.tool() decorator registers this function as an MCP tool named 'openfda_recall_getter'.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_recall_getter")
  • Pydantic-based input schema definition using Annotated with Field descriptions for tool parameters.
    recall_number: Annotated[
        str,
        Field(description="FDA recall number"),
    ],
    api_key: Annotated[
        str | None,
        Field(
            description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
        ),
    ] = None,
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool returns 'complete recall details' with a bulleted list of data types, which adds useful context about output behavior. However, it does not mention authentication needs (e.g., API key usage), rate limits, or error handling, leaving gaps in behavioral transparency.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by a bulleted list of return details. Every sentence earns its place by adding value without redundancy or waste.

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 (context signals indicate 'Has output schema: true'), the description does not need to explain return values in detail. It provides a high-level overview of returned data, which is sufficient. However, for a tool with no annotations and two parameters, it could benefit from more behavioral context (e.g., authentication or error handling) to be fully complete.

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 both parameters ('recall_number' and 'api_key') with descriptions. The description does not add any parameter-specific information beyond what the schema provides, such as format examples or constraints, meeting the baseline for high schema 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 with specific verb+resource: 'Get detailed FDA drug recall information for a specific recall.' It distinguishes from its sibling 'openfda_recall_searcher' by focusing on retrieving details for a specific recall rather than searching.

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 implies usage context by specifying 'for a specific recall,' but does not explicitly state when to use this tool versus alternatives like 'openfda_recall_searcher' or other FDA-related tools. It provides clear context but lacks explicit exclusions or named alternatives.

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