Skip to main content
Glama

openfda_adverse_getter

Retrieve detailed FDA adverse event reports including patient demographics, drug details, adverse reactions, and outcomes using a specific report ID. Access critical biomedical data via BioMCP.

Instructions

Get detailed information for a specific FDA adverse event report.

Retrieves complete details including:
- Patient demographics and medical history
- All drugs involved and dosages
- Complete list of adverse reactions
- Event narrative and outcomes
- Reporter information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoOptional OpenFDA API key (overrides OPENFDA_API_KEY env var)
report_idYesSafety report ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler and registration for 'openfda_adverse_getter'. Defines input schema via Annotated Fields and delegates to core implementation.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_adverse_getter")
    async def openfda_adverse_getter(
        report_id: Annotated[
            str,
            Field(description="Safety report ID"),
        ],
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
        """Get detailed information for a specific FDA adverse event report.
    
        Retrieves complete details including:
        - Patient demographics and medical history
        - All drugs involved and dosages
        - Complete list of adverse reactions
        - Event narrative and outcomes
        - Reporter information
        """
        from biomcp.openfda import get_adverse_event
    
        return await get_adverse_event(report_id, api_key=api_key)
  • Core helper function implementing the OpenFDA adverse event retrieval and formatting logic, called by the MCP handler.
    async def get_adverse_event(report_id: str, api_key: str | None = None) -> str:
        """
        Get detailed information for a specific adverse event report.
    
        Args:
            report_id: Safety report ID
            api_key: Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)
    
        Returns:
            Formatted string with detailed report information
        """
        params = {
            "search": f'safetyreportid:"{report_id}"',
            "limit": 1,
        }
    
        response, error = await make_openfda_request(
            OPENFDA_DRUG_EVENTS_URL,
            params,
            "openfda_adverse_event_detail",
            api_key,
        )
    
        if error:
            return f"⚠️ Error retrieving adverse event report: {error}"
    
        if not response or not response.get("results"):
            return f"Adverse event report '{report_id}' not found."
    
        result = response["results"][0]
        patient = result.get("patient", {})
    
        # Build detailed output
        output = [f"## Adverse Event Report: {report_id}\n"]
    
        # Patient Information
        output.extend(_format_patient_info(patient))
    
        # Drug Information
        if drugs := patient.get("drug", []):
            output.extend(format_drug_details(drugs))
    
        # Reactions
        if reactions := patient.get("reaction", []):
            output.extend(format_reaction_details(reactions))
    
        # Event Summary
        if summary := patient.get("summary", {}).get("narrativeincludeclinical"):
            output.append("### Event Narrative")
            output.append(clean_text(summary))
            output.append("")
    
        # Report metadata
        output.extend(format_report_metadata(result))
    
        output.append(f"\n{OPENFDA_DISCLAIMER}")
        return "\n".join(output)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the tool's behavior as a retrieval operation ('Get detailed information'), which implies it's read-only and non-destructive, but lacks details on authentication needs (e.g., API key usage), rate limits, error handling, or data freshness. It adds some context by listing the types of details retrieved, but more behavioral traits would be helpful.

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, starting with a clear purpose statement followed by a bulleted list of details retrieved. Every sentence and bullet point earns its place by adding specific value without redundancy.

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's moderate complexity (retrieving detailed report data), no annotations, and an output schema present (which handles return values), the description is mostly complete. It covers the purpose and scope well but could benefit from more behavioral context (e.g., authentication, limitations) to fully compensate for the lack of annotations.

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 thoroughly. The description does not add any meaning beyond what the schema provides (e.g., it doesn't explain parameter interactions or provide examples). Baseline 3 is appropriate as the schema handles the heavy lifting.

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 a specific verb ('Get detailed information') and resource ('FDA adverse event report'), and distinguishes it from its sibling 'openfda_adverse_searcher' by focusing on retrieving complete details for a specific report rather than searching. The bullet points further specify the scope of information retrieved.

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 it retrieves details for 'a specific FDA adverse event report,' suggesting it should be used when you have a report ID. However, it does not explicitly state when not to use it or name alternatives like 'openfda_adverse_searcher' for broader searches, though the distinction is clear from the purpose.

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