Openfoodfacts Tools

Configuration File: openfoodfacts_tools.json Tool Type: Local Tools Count: 3

This page contains all tools defined in the openfoodfacts_tools.json configuration file.

Available Tools

OpenFoodFacts_filter_products_by_tags (Type: BaseRESTTool)

Structured / faceted product search of the Open Food Facts database via the v2 search API. Filter…

OpenFoodFacts_filter_products_by_tags tool specification

Tool Information:

  • Name: OpenFoodFacts_filter_products_by_tags

  • Type: BaseRESTTool

  • Description: Structured / faceted product search of the Open Food Facts database via the v2 search API. Filter products by controlled-vocabulary tag fields rather than free text: additives_tags (e.g. ‘en:e322’ = lecithin), allergens_tags (e.g. ‘en:peanuts’), categories_tags_en (e.g. ‘Sodas’), brands_tags, nutrition_grades_tags (Nutri-Score a-e), labels_tags (e.g. ‘en:organic’), and countries_tags (e.g. ‘en:france’). This answers queries the legacy name/brand search cannot, such as ‘all products containing additive E322’, ‘all peanut-allergen products’, or ‘category Sodas with Nutri-Score a’. Multiple tag filters combine with AND. Use the ‘fields’ parameter to control which product fields are returned. No API key required.

Parameters:

  • additives_tags ([‘string’, ‘null’]) (optional) Filter by food-additive tag, e.g. ‘en:e322’ (lecithin), ‘en:e330’ (citric acid). Find tags via the product profile additives_tags field.

  • allergens_tags ([‘string’, ‘null’]) (optional) Filter by allergen tag, e.g. ‘en:peanuts’, ‘en:milk’, ‘en:gluten’.

  • categories_tags_en ([‘string’, ‘null’]) (optional) Filter by English category name, e.g. ‘Sodas’, ‘Breakfast cereals’, ‘Olive oils’.

  • brands_tags ([‘string’, ‘null’]) (optional) Filter by brand tag, e.g. ‘coca-cola’, ‘nestle’.

  • nutrition_grades_tags ([‘string’, ‘null’]) (optional) Filter by Nutri-Score grade: ‘a’, ‘b’, ‘c’, ‘d’, or ‘e’.

  • labels_tags ([‘string’, ‘null’]) (optional) Filter by label tag, e.g. ‘en:organic’, ‘en:vegan’, ‘en:gluten-free’, ‘en:fair-trade’.

  • countries_tags ([‘string’, ‘null’]) (optional) Filter by country tag, e.g. ‘en:france’, ‘en:united-states’.

  • fields ([‘string’, ‘null’]) (optional) Comma-separated list of product fields to return. Default: product_name,code,brands,categories_tags_en,nutrition_grades,additives_tags,allergens_tags,labels_tags,nutriments

  • page_size ([‘integer’, ‘null’]) (optional) Number of results per page (1-100). Default: 20

  • page ([‘integer’, ‘null’]) (optional) Page number for pagination. Default: 1

Example Usage:

query = {
    "name": "OpenFoodFacts_filter_products_by_tags",
    "arguments": {
    }
}
result = tu.run(query)

OpenFoodFacts_get_product (Type: BaseRESTTool)

Get detailed information about a specific food product by barcode using the Open Food Facts datab…

OpenFoodFacts_get_product tool specification

Tool Information:

  • Name: OpenFoodFacts_get_product

  • Type: BaseRESTTool

  • Description: Get detailed information about a specific food product by barcode using the Open Food Facts database. Returns complete nutritional data, ingredients, allergens, Nutri-Score, eco-score, and product images. No authentication required.

Parameters:

  • barcode (string) (required) Product barcode (EAN-13 or UPC). Examples: ‘3017620422003’ (Nutella 400g), ‘0737628064502’ (Annie Chun’s), ‘8001505005592’

Example Usage:

query = {
    "name": "OpenFoodFacts_get_product",
    "arguments": {
        "barcode": "example_value"
    }
}
result = tu.run(query)

OpenFoodFacts_search_products (Type: BaseRESTTool)

Search for food products in the Open Food Facts database by name or brand. Returns product detail…

OpenFoodFacts_search_products tool specification

Tool Information:

  • Name: OpenFoodFacts_search_products

  • Type: BaseRESTTool

  • Description: Search for food products in the Open Food Facts database by name or brand. Returns product details including nutrition grades (Nutri-Score A-E), ingredients, nutrients (calories, fat, sugar, salt, protein), and food categories. Over 3 million products from worldwide. No authentication required.

Parameters:

  • search_terms (string) (required) Food product name or brand to search for. Examples: ‘nutella’, ‘coca cola’, ‘oreo’, ‘kelloggs cornflakes’, ‘olive oil’

  • page_size ([‘integer’, ‘null’]) (optional) Number of results per page (1-100). Default: 10

  • page ([‘integer’, ‘null’]) (optional) Page number for pagination. Default: 1

Example Usage:

query = {
    "name": "OpenFoodFacts_search_products",
    "arguments": {
        "search_terms": "example_value"
    }
}
result = tu.run(query)