Skip to main content
Glama

openfda_device_getter

Retrieve comprehensive FDA device event reports, including device details, event narratives, patient outcomes, and manufacturer actions for analysis and decision-making.

Instructions

Get detailed information for a specific FDA device event report.

Retrieves complete device event details including:
- Device identification and specifications
- Complete event narrative
- Patient outcomes and impacts
- Manufacturer analysis and actions
- Remedial actions taken

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary MCP tool handler function 'openfda_device_getter' that defines the tool schema, registers it via @mcp_app.tool(), and delegates to the core get_device_event implementation.
    @track_performance("biomcp.openfda_device_getter")
    async def openfda_device_getter(
        mdr_report_key: Annotated[
            str,
            Field(description="MDR report key"),
        ],
        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 device event report.
    
        Retrieves complete device event details including:
        - Device identification and specifications
        - Complete event narrative
        - Patient outcomes and impacts
        - Manufacturer analysis and actions
        - Remedial actions taken
        """
        from biomcp.openfda import get_device_event
    
        return await get_device_event(mdr_report_key, api_key=api_key)
  • Core helper function that performs the OpenFDA API request for a specific device event report by MDR report key and formats the detailed response using specialized formatters.
    async def get_device_event(
        mdr_report_key: str, api_key: str | None = None
    ) -> str:
        """
        Get detailed information for a specific device event report.
    
        Args:
            mdr_report_key: MDR report key
            api_key: Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)
    
        Returns:
            Formatted string with detailed report information
        """
        params = {
            "search": f'mdr_report_key:"{mdr_report_key}"',
            "limit": 1,
        }
    
        response, error = await make_openfda_request(
            OPENFDA_DEVICE_EVENTS_URL,
            params,
            "openfda_device_event_detail",
            api_key,
        )
    
        if error:
            return f"⚠️ Error retrieving device event report: {error}"
    
        if not response or not response.get("results"):
            return f"Device event report '{mdr_report_key}' not found."
    
        result = response["results"][0]
    
        # Build detailed output
        output = format_device_detail_header(result, mdr_report_key)
    
        # Device details
        if devices := result.get("device", []):
            output.extend(format_detailed_device_info(devices))
    
        # Event narrative
        if event_desc := result.get("event_description"):
            output.append("### Event Description")
            output.append(clean_text(event_desc))
            output.append("")
    
        # Manufacturer narrative
        if mfr_narrative := result.get("manufacturer_narrative"):
            output.append("### Manufacturer's Analysis")
            output.append(clean_text(mfr_narrative))
            output.append("")
    
        # Patient information
        if patient := result.get("patient", []):
            output.extend(format_patient_details(patient))
    
        # Remedial action
        if remedial := result.get("remedial_action"):
            output.append("### Remedial Action")
            if isinstance(remedial, list):
                output.append(", ".join(remedial))
            else:
                output.append(remedial)
            output.append("")
    
        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?

No annotations are provided, so the description carries the full burden. It discloses the tool's behavior as a retrieval operation with specific data categories returned, but lacks details on error handling, rate limits, authentication needs (though the api_key parameter hints at this), or response format. It adds some context but is incomplete for a tool with no annotations.

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 front-loaded with the core purpose in the first sentence, followed by a bulleted list of retrieved details that efficiently elaborates without redundancy. Every sentence earns its place by clarifying scope and content.

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 (2 parameters, no annotations, but with output schema), the description is reasonably complete: it explains what data is retrieved, which compensates for lack of output schema details. However, it could better address behavioral aspects like error cases or usage constraints.

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 (mdr_report_key as required, api_key as optional with env var override). The description doesn't add meaning beyond what the schema provides (e.g., no examples of valid report keys or api_key usage scenarios), 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 specific action ('Get detailed information', 'Retrieves complete device event details') and resource ('FDA device event report'), distinguishing it from sibling tools like openfda_device_searcher (which searches rather than gets specific reports) and other getter tools focused on different data types (e.g., drug_getter, trial_getter).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying it retrieves details for 'a specific FDA device event report', suggesting it's for known report keys rather than searching. However, it doesn't explicitly state when to use this vs. alternatives like openfda_device_searcher or provide exclusions (e.g., not for batch retrieval).

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