search_products

Pack: open-food-facts · Endpoint: https://gateway.pipeworx.io/open-food-facts/mcp

Search food products by name or keyword. Returns product name, brand, nutrition facts (per 100g), Nutri-Score, NOVA group, allergens, and ingredients. Example: search_products(“nutella”, “spreads”).

Parameters

NameTypeRequiredDescription
querystringyesProduct name or keyword (e.g., “oat milk”, “chocolate”)
categoriesstringnoCategory tag to filter by (e.g., “beverages”, “cereals”)
limitnumbernoNumber of results to return (default: 10, max: 50)

Example call

Arguments

{
  "query": "oat milk"
}

curl

curl -X POST https://gateway.pipeworx.io/open-food-facts/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_products","arguments":{"query":"oat milk"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('search_products', {
  "query": "oat milk"
});

More examples

{
  "query": "chocolate",
  "categories": "spreads",
  "limit": 20
}

Response shape

Always returns: query, categories, total, returned, products

FieldTypeDescription
querystringThe search query used
categoriesstring | nullCategory filter applied, if any
totalnumberTotal number of products matching query
returnednumberNumber of products returned in this response
productsarrayList of formatted product objects
Full JSON Schema
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "The search query used"
    },
    "categories": {
      "type": [
        "string",
        "null"
      ],
      "description": "Category filter applied, if any"
    },
    "total": {
      "type": "number",
      "description": "Total number of products matching query"
    },
    "returned": {
      "type": "number",
      "description": "Number of products returned in this response"
    },
    "products": {
      "type": "array",
      "description": "List of formatted product objects",
      "items": {
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product barcode (EAN/UPC)"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product name"
          },
          "brands": {
            "type": [
              "string",
              "null"
            ],
            "description": "Brand name(s)"
          },
          "categories": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product categories"
          },
          "countries": {
            "type": [
              "string",
              "null"
            ],
            "description": "Countries of origin"
          },
          "quantity": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product quantity/size"
          },
          "ingredients": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ingredients list"
          },
          "nutriscore": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nutri-Score grade (A-E)"
          },
          "nova_group": {
            "type": [
              "number",
              "null"
            ],
            "description": "NOVA processing group (1-4)"
          },
          "ecoscore": {
            "type": [
              "string",
              "null"
            ],
            "description": "Eco-Score grade"
          },
          "allergens": {
            "type": [
              "string",
              "null"
            ],
            "description": "Allergens present"
          },
          "labels": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product labels/certifications"
          },
          "nutrition_per_100g": {
            "type": [
              "object",
              "null"
            ],
            "description": "Nutritional values per 100g",
            "properties": {
              "energy_kcal": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Energy in kcal"
              },
              "fat_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Fat in grams"
              },
              "saturated_fat_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Saturated fat in grams"
              },
              "carbs_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Carbohydrates in grams"
              },
              "sugars_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Sugars in grams"
              },
              "fiber_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Dietary fiber in grams"
              },
              "protein_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Protein in grams"
              },
              "salt_g": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Salt in grams"
              }
            }
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Product image URL"
          }
        },
        "required": [
          "barcode",
          "name",
          "brands",
          "categories",
          "countries",
          "quantity",
          "ingredients",
          "nutriscore",
          "nova_group",
          "ecoscore",
          "allergens",
          "labels",
          "nutrition_per_100g",
          "image_url"
        ]
      }
    }
  },
  "required": [
    "query",
    "categories",
    "total",
    "returned",
    "products"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "open-food-facts": {
      "url": "https://gateway.pipeworx.io/open-food-facts/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026