Skip to main content
Glama

openfda_label_getter

Retrieve complete FDA drug label information by set ID, including indications, dosing, warnings, pharmacology, and manufacturing details. Specify sections for targeted data or use default key sections.

Instructions

Get complete FDA drug label information by set ID.

Retrieves the full prescribing information including:
- Complete indications and usage text
- Detailed dosing instructions
- All warnings and precautions
- Clinical pharmacology and studies
- Manufacturing and storage information

Specify sections to retrieve specific parts, or leave empty for default key sections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoOptional OpenFDA API key (overrides OPENFDA_API_KEY env var)
sectionsNoSpecific sections to retrieve (default: key sections)
set_idYesLabel set ID

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for openfda_label_getter, including schema definition via Annotated Fields and registration via @mcp_app.tool() decorator. Delegates to get_drug_label implementation.
    @mcp_app.tool()
    @track_performance("biomcp.openfda_label_getter")
    async def openfda_label_getter(
        set_id: Annotated[
            str,
            Field(description="Label set ID"),
        ],
        sections: Annotated[
            list[str] | None,
            Field(
                description="Specific sections to retrieve (default: key sections)"
            ),
        ] = None,
        api_key: Annotated[
            str | None,
            Field(
                description="Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)"
            ),
        ] = None,
    ) -> str:
        """Get complete FDA drug label information by set ID.
    
        Retrieves the full prescribing information including:
        - Complete indications and usage text
        - Detailed dosing instructions
        - All warnings and precautions
        - Clinical pharmacology and studies
        - Manufacturing and storage information
    
        Specify sections to retrieve specific parts, or leave empty for default key sections.
        """
        from biomcp.openfda import get_drug_label
    
        return await get_drug_label(set_id, sections, api_key=api_key)
  • Core implementation of the drug label retrieval logic, querying OpenFDA API by set_id, formatting specific sections of the label, handling boxed warnings, and returning formatted output.
    async def get_drug_label(
        set_id: str,
        sections: list[str] | None = None,
        api_key: str | None = None,
    ) -> str:
        """
        Get detailed drug label information by set ID.
    
        Args:
            set_id: Label set ID
            sections: Specific sections to retrieve (default: key sections)
    
            api_key: Optional OpenFDA API key (overrides OPENFDA_API_KEY env var)
    
        Returns:
            Formatted string with detailed label information
        """
        params = {
            "search": f'set_id:"{set_id}"',
            "limit": 1,
        }
    
        response, error = await make_openfda_request(
            OPENFDA_DRUG_LABELS_URL, params, "openfda_drug_label_detail", api_key
        )
    
        if error:
            return f"⚠️ Error retrieving drug label: {error}"
    
        if not response or not response.get("results"):
            return f"Drug label with ID '{set_id}' not found."
    
        result = response["results"][0]
    
        # Use default sections if not specified
        if not sections:
            sections = get_default_sections()
    
        # Build output
        output = format_label_header(result, set_id)
    
        # Boxed warning (if exists)
        if "boxed_warning" in result:
            output.extend(_format_boxed_warning(result["boxed_warning"]))
    
        # Display requested sections
        section_titles = get_section_titles()
        for section in sections:
            output.extend(format_label_section(result, section, section_titles))
    
        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 that the tool retrieves 'complete' information and lists specific content types (e.g., indications, dosing), which adds useful behavioral context. However, it lacks details on potential limitations like rate limits, authentication needs (though the api_key parameter hints at this), or error handling, leaving gaps in 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 content details and a final sentence on parameter usage. Every sentence adds value without redundancy, making it efficient and well-structured.

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 (3 parameters, 1 required), no annotations, and the presence of an output schema, the description is mostly complete. It covers purpose, content details, and basic parameter guidance. However, it could be more complete by addressing authentication implications or error scenarios, which are relevant given the api_key parameter and 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 all parameters (set_id, sections, api_key) well. The description adds minimal value beyond the schema: it mentions that sections can be specified to retrieve specific parts or left empty for default, which slightly elaborates on the schema's 'default: key sections'. This meets the baseline of 3 when schema coverage is high.

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 verb ('Get', 'Retrieves') and resource ('complete FDA drug label information by set ID'), making the purpose specific and unambiguous. It distinguishes itself from sibling tools like 'openfda_label_searcher' by focusing on retrieval of full label data for a given set ID rather than searching across labels.

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 provides clear context for usage: it specifies that this tool is for retrieving full label information by set ID, implying it should be used when you have a specific label set ID. However, it does not explicitly state when not to use it or name alternatives (e.g., 'openfda_label_searcher' for searching instead of direct retrieval), which prevents a score of 5.

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