Skip to main content
Glama

get_opinions

Retrieve published EFSA scientific opinions and regulatory documents for food safety assessments using document identifiers. Access full scientific evaluations, publication metadata, and regulatory context from the OpenFoodTox database.

Instructions

Get EFSA opinion documents from OPINION table by OP_ID.

Retrieves published EFSA scientific opinions, assessments, and regulatory documents.
This tool provides access to the original source documents that contain the full
scientific assessment and regulatory context for food safety evaluations.

Args:
    op_id: Single OP_ID (int) or list of OP_IDs (list[int]) to query.
          Use search_substance tool first to find OP_IDs through the STUDY table.

Returns:
    JSON string containing a DataFrame with opinion document records. Each record
    includes publication metadata, regulatory information, and document access details.

The returned data includes:
- Document identification: DOCUMENT_ID, OP_ID, TRX_ID
- Document type: DOCTYPE, DOCTYPE_CODE
- Publication details: TITLE, AUTHOR, PUBLICATIONDATE, ADOPTIONDATE, PUBLICATIONYEAR
- Access information: DOI, URL
- Regulatory context: REGULATION_CODE, REGULATION, REGULATIONFULLTEXT
- Ownership: OWNER

Note: Multiple records may be returned if multiple OP_IDs are provided. Each opinion
represents a published EFSA assessment document that may contain multiple substances
or studies.

<dictionary_descriptions>
<name>OP_ID</name>
<description>Unique identifier for the EFSA opinion document</description>
<name>DOCUMENT_ID</name>
<description>Unique document identifier</description>
<name>DOCTYPE</name>
<description>Type of document (e.g., "Scientific Opinion", "Statement")</description>
<name>TITLE</name>
<description>Title of the published opinion document</description>
<name>AUTHOR</name>
<description>Author(s) of the publication</description>
<name>PUBLICATIONDATE</name>
<description>Date when the document was published (format: yyyymmdd)</description>
<name>ADOPTIONDATE</name>
<description>Date when the document was adopted (format: yyyymmdd)</description>
<name>PUBLICATIONYEAR</name>
<description>Year of publication</description>
<name>DOI</name>
<description>Digital Object Identifier for the publication</description>
<name>URL</name>
<description>URL link to the published document</description>
<name>REGULATION_CODE</name>
<description>EU regulation code (e.g., "1333/2008" for food additives, "1107/2009" for pesticides)</description>
<name>REGULATION</name>
<description>Short name or description of the regulation</description>
<name>REGULATIONFULLTEXT</name>
<description>Full text description of the regulation</description>
<name>OWNER</name>
<description>Organization or entity that owns or published the document</description>
</dictionary_descriptions>

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
op_idYes

Implementation Reference

  • The handler function for the get_opinions tool. It queries the OPINION table for opinion documents by OP_ID using a database helper and returns the results as JSON.
    def get_opinions(op_id: Union[int, list[int]]):
        """
        Get EFSA opinion documents from OPINION table by OP_ID.
    
        Retrieves published EFSA scientific opinions, assessments, and regulatory documents.
        This tool provides access to the original source documents that contain the full
        scientific assessment and regulatory context for food safety evaluations.
    
        Args:
            op_id: Single OP_ID (int) or list of OP_IDs (list[int]) to query.
                  Use search_substance tool first to find OP_IDs through the STUDY table.
    
        Returns:
            JSON string containing a DataFrame with opinion document records. Each record
            includes publication metadata, regulatory information, and document access details.
    
        The returned data includes:
        - Document identification: DOCUMENT_ID, OP_ID, TRX_ID
        - Document type: DOCTYPE, DOCTYPE_CODE
        - Publication details: TITLE, AUTHOR, PUBLICATIONDATE, ADOPTIONDATE, PUBLICATIONYEAR
        - Access information: DOI, URL
        - Regulatory context: REGULATION_CODE, REGULATION, REGULATIONFULLTEXT
        - Ownership: OWNER
    
        Note: Multiple records may be returned if multiple OP_IDs are provided. Each opinion
        represents a published EFSA assessment document that may contain multiple substances
        or studies.
    
        <dictionary_descriptions>
        <name>OP_ID</name>
        <description>Unique identifier for the EFSA opinion document</description>
        <name>DOCUMENT_ID</name>
        <description>Unique document identifier</description>
        <name>DOCTYPE</name>
        <description>Type of document (e.g., "Scientific Opinion", "Statement")</description>
        <name>TITLE</name>
        <description>Title of the published opinion document</description>
        <name>AUTHOR</name>
        <description>Author(s) of the publication</description>
        <name>PUBLICATIONDATE</name>
        <description>Date when the document was published (format: yyyymmdd)</description>
        <name>ADOPTIONDATE</name>
        <description>Date when the document was adopted (format: yyyymmdd)</description>
        <name>PUBLICATIONYEAR</name>
        <description>Year of publication</description>
        <name>DOI</name>
        <description>Digital Object Identifier for the publication</description>
        <name>URL</name>
        <description>URL link to the published document</description>
        <name>REGULATION_CODE</name>
        <description>EU regulation code (e.g., "1333/2008" for food additives, "1107/2009" for pesticides)</description>
        <name>REGULATION</name>
        <description>Short name or description of the regulation</description>
        <name>REGULATIONFULLTEXT</name>
        <description>Full text description of the regulation</description>
        <name>OWNER</name>
        <description>Organization or entity that owns or published the document</description>
        </dictionary_descriptions>
        """
        df = query_by_id(op_id, "opinion")
        return df.to_json()
  • main.py:22-22 (registration)
    Registers the get_opinions tool with the FastMCP server.
    mcp.add_tool(get_opinions)
  • main.py:6-6 (registration)
    Imports the get_opinions handler function for registration.
    from src.mcp_openfoodtox.tools.get_opinions import get_opinions
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it retrieves published documents, explains the return format (JSON string containing DataFrame), details what data is included, and notes that multiple records may be returned for multiple OP_IDs. It doesn't mention performance characteristics like rate limits or error handling, but covers core operational behavior well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, args, returns, data details) and uses bullet points effectively. While comprehensive, it maintains focus with minimal redundancy. The dictionary descriptions section is extensive but organized, though it could be slightly more concise for a tool description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (1 parameter but extensive return data), no annotations, and no output schema, the description provides exceptional completeness. It covers purpose, usage workflow, parameter semantics, return format, detailed field descriptions, and behavioral notes about multiple records. This fully compensates for the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It provides comprehensive parameter semantics: explains op_id accepts single integer or list of integers, clarifies it's the unique identifier for EFSA opinion documents, and provides workflow guidance about finding OP_IDs through the STUDY table. The dictionary descriptions section further elaborates on all related fields, adding significant value beyond the bare schema.

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 verbs ('Get', 'Retrieves') and resources ('EFSA opinion documents from OPINION table by OP_ID'), distinguishing it from siblings like search_substance (which finds OP_IDs) and other data retrieval tools. It explicitly mentions the source table and key identifier.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool versus alternatives: 'Use search_substance tool first to find OP_IDs through the STUDY table.' This clearly directs users to a specific sibling tool for prerequisite steps, establishing a workflow context.

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

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/spyrosze/mcp-openfoodtox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server