Open Food Facts

v2.6.0
io.github.domdomegg/openfoodfacts-mcp Checked 14 hours ago Published 4 months ago

Search and contribute to the Open Food Facts database.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_product Get product

Get product information from Open Food Facts by barcode. Reads the primary database directly (no sync lag), so this is always current even when search_products returns stale results. Prefer this over search whenever you have a barcode. If this returns "product not found", the product genuinely isn't in the database — you can add it with add_or_edit_product.

ParameterTypeDescription
barcode *stringProduct barcode (EAN-13, UPC-A, etc.)
fieldsarrayFields to return. By default ALL fields are returned — nothing is omitted, so a field is never misleadingly null/absent just because it wasn't requested (e.g. `images` is always populated when the p…
languagestringLanguage code for language-dependent fields (product_name, generic_name, ingredients_text). Defaults to "en". When a product has a different primary language, the unsuffixed field names return that la…

search_products_standard Search products (standard)

Search Open Food Facts with structured filters. Best for simple keyword queries and brand/category filtering. Returns exact result counts and well-populated products. If you have a barcode, use get_product instead. How search works: strict AND against a keyword index built from product_name, generic_name, brands, categories, origins, labels. One unmatched query word → zero results. Tips: - Prefer 2-3 distinctive words over the full product name - Put brand names in brands_tags, not the query text - Brand normalization is generous: "sainsburys", "sainsbury's", "sainsbury-s" all match - For…

ParameterTypeDescription
brands_tagsstringFilter by brand. Input is normalized, so "sainsburys", "sainsbury's", "sainsbury-s" all match the same brand — no need to know the exact tag slug. More reliable than putting the brand in the query t…
categories_tagsstringFilter by category tag (e.g. "en:breakfast-cereals", "en:tomatoes"). Best way to find fresh produce: text-searching "banana" matches thousands of banana-flavoured products, but categories_tags "en:ban…
fieldsarrayFields to return per product. Defaults to: code, product_name, brands, categories, nutriscore_grade, nova_group, image_url, quantity
nutrition_grades_tagsstringFilter by Nutri-Score grade (a, b, c, d, e)
pageintegerPage number (default: 1)
page_sizeintegerResults per page (default: 24, max: 100)
querystringSearch terms. Strict AND: every word must exist in the product's indexed keywords, so prefer 2-3 distinctive words over the full product name. Use words as they appear on the pack (don't strip plurals…
sort_bystringSort order

search_products_lucene Search products (Lucene)

Search Open Food Facts using the Search-a-licious Elasticsearch backend. Powered by Lucene query syntax with full boolean logic and negation support. Use this instead of search_products_standard when you need: - Negation queries: find gluten-free cereals with allergens_tags_without="en:gluten" - Filter-only browsing: categories_tags without any text query (standard API times out on this) - Combined text + filter with relevance scoring: text matches are ranked by relevance within filter results - Boolean logic in raw Lucene: brands:"kellogg*" OR brands:"nestle" Trade-offs vs search_products_s…

ParameterTypeDescription
allergens_tags_withoutstringEXCLUDE products containing this allergen (e.g. "en:gluten", "en:milk"). This is negation — a capability unique to this tool. Added as -allergens_tags:"value". Use for allergen-free searches.
brands_tagsstringFilter by brand tag (e.g. "nutella"). Added as brands_tags:"value" in the Lucene query.
categories_tagsstringFilter by category tag (e.g. "en:breakfast-cereals"). Added as categories_tags:"value" in the Lucene query.
countries_tagsstringFilter by country tag (e.g. "en:united-kingdom", "en:france"). Added as countries_tags:"value".
fieldsarrayFields to return per product. Defaults to: code, product_name, brands, categories, nutriscore_grade, nova_group, image_url, quantity
labels_tagsstringFilter by label tag (e.g. "en:organic", "en:fair-trade"). Added as labels_tags:"value".
lucene_querystringRaw Lucene query string for full control. If provided, all other filter params are ignored. Supports field:value, negation (-field:value), quoted phrases, wildcards. Examples: 'categories_tags:"en:bev…
nutrition_grades_tagsstringFilter by Nutri-Score grade (a, b, c, d, e). Added as nutriscore_grade:"value".
pageintegerPage number (default: 1)
page_sizeintegerResults per page (default: 24, max: 100)
querystringFree-text search terms. Combined with any filter params using AND logic. Omit to browse by filters alone (unlike search_products_standard, filter-only queries work here without timeouts).
sort_bystringSort order. Note: uses different underlying fields than search_products_standard.
sort_descendingbooleanSort in descending order (default: true). Set false for ascending (e.g. lowest nutriscore_score first).

autocomplete Autocomplete

Get autocomplete suggestions for Open Food Facts taxonomy entries (brands, categories, labels, etc.).

ParameterTypeDescription
query *stringSearch prefix
tagtype *stringType of taxonomy to search
lcstringLanguage code (default: en)
limitintegerMax results (default: 10, max: 100)

add_or_edit_product Add or edit product

Add a new product or edit an existing one on Open Food Facts. Requires OFF_USER_ID and OFF_PASSWORD. The more fields you fill, the more useful the entry. At minimum provide product_name, brands, and categories — these feed the search index, and a sparse entry won't be findable. If you have a photo of the pack, transcribe everything you can read: ingredients, nutrition, origins, traceability stamps, recycling icons, certifications. Fields that drive derived data: - ingredients_text → allergens, additives, NOVA group, fruit/veg % - nutrition + categories → Nutri-Score - packagings + orig…

upload_image Upload product image

Upload a product image to Open Food Facts. Requires OFF_USER_ID and OFF_PASSWORD. Prefer more photos over fewer. Panels with text (ingredients, nutrition, certifications, recycling instructions) are highest value as OFF can OCR them. Plain sides with just a colour or logo are lowest value but still worth uploading if you have them. Use the most appropriate imagefield (front, ingredients, nutrition, packaging). Use "other" for additional photos — this uploads without selecting the image as a display image, which is useful when a good display image already exists or for supplementary angles.…

ParameterTypeDescription
barcode *stringProduct barcode
image_data *stringBase64-encoded image data (JPEG or PNG)
imagefield *stringImage type
lcstringLanguage code for the image (default: en)

select_image Select/crop product image

Select, crop, and rotate a previously uploaded product image on Open Food Facts. Requires OFF_USER_ID and OFF_PASSWORD.

ParameterTypeDescription
barcode *stringProduct barcode
imagefield *stringImage type to assign this image to
imgid *integerImage ID (from upload_image response or product data)
anglestringRotation angle in degrees
lcstringLanguage code (default: en)
x1numberCrop: left coordinate
x2numberCrop: right coordinate
y1numberCrop: top coordinate
y2numberCrop: bottom coordinate

call_api Call API

Make a direct call to any Open Food Facts API endpoint. Use get_api_docs to see available endpoints. Auth credentials are included automatically for write operations if configured. Two body modes for writes: - params: form-encoded (for /cgi/*.pl and /api/v2/* legacy endpoints) - json_body: raw JSON (for /api/v3/* endpoints — required for structured fields like packagings) Example v3 packagings write: method: PATCH endpoint: /api/v3/product/0123456789012 json_body: {"fields":"packagings","product":{"packagings":[{"number_of_units":1,"shape":{"id":"en:bag"},"material":{"id":"en:plastic…

ParameterTypeDescription
endpoint *stringAPI endpoint path (e.g. "/api/v2/product/3017620422003.json")
json_bodyobjectRaw JSON body for v3 endpoints (e.g. PATCH /api/v3/product/{code}). When set, params is ignored and Content-Type is application/json. Auth fields are injected at the top level. Use this for structured…
methodstringHTTP method (default: GET)
paramsobjectQuery parameters (for GET) or form-encoded body fields (for POST/PUT/PATCH to v1/v2 endpoints like /cgi/product_jqm2.pl). Auth fields are added automatically.

get_api_docs Get API docs

Get Open Food Facts API documentation. Useful for understanding available endpoints before using call_api.

get_skill Get skill

Get the OFF upload skill document. This describes the recommended process for bulk uploading food packaging photos to Open Food Facts.