Skip to main content
Glama
domdomegg

openfoodfacts-mcp

Search products (Lucene)

search_products_lucene
Read-only

Search Open Food Facts using Lucene queries with boolean logic, negation, and filter-only browsing. Exclude allergens like gluten or refine by category and brand tags for precise results.

Instructions

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_standard:

  • Counts are approximate (capped at 10,000 for large result sets)

  • Brand tag matching may be narrower (less normalization than standard)

  • Data has a short sync delay (hours) from the primary database

  • popularity sort uses scan counts rather than the standard popularity algorithm

Response format matches search_products_standard: { count, page, page_size, page_count, products: [...] }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoFree-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).
categories_tagsNoFilter by category tag (e.g. "en:breakfast-cereals"). Added as categories_tags:"value" in the Lucene query.
brands_tagsNoFilter by brand tag (e.g. "nutella"). Added as brands_tags:"value" in the Lucene query.
nutrition_grades_tagsNoFilter by Nutri-Score grade (a, b, c, d, e). Added as nutriscore_grade:"value".
labels_tagsNoFilter by label tag (e.g. "en:organic", "en:fair-trade"). Added as labels_tags:"value".
countries_tagsNoFilter by country tag (e.g. "en:united-kingdom", "en:france"). Added as countries_tags:"value".
allergens_tags_withoutNoEXCLUDE 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.
lucene_queryNoRaw 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:beverages" nutriscore_grade:a -allergens_tags:"en:gluten"', 'brands:"kellogg*"'
sort_byNoSort order. Note: uses different underlying fields than search_products_standard.
sort_descendingNoSort in descending order (default: true). Set false for ascending (e.g. lowest nutriscore_score first).
pageNoPage number (default: 1)
page_sizeNoResults per page (default: 24, max: 100)
fieldsNoFields to return per product. Defaults to: code, product_name, brands, categories, nutriscore_grade, nova_group, image_url, quantity
Behavior4/5

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

Annotations already indicate readOnlyHint=true. The description adds valuable behavioral details including approximate counts, sync delay, narrower brand matching, and sort differences, though does not mention pagination behavior explicitly.

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 bullet points and a clear front-loaded purpose, but it is somewhat lengthy. Every sentence adds value, but slight trimming could improve conciseness.

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 13 parameters with full schema coverage, no output schema, and simple annotations, the description sufficiently covers usage, trade-offs, and parameter details. It provides enough context for correct tool selection and use.

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

Parameters4/5

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

Schema coverage is 100%. The description adds meaningful context beyond the schema, such as explaining that allergens_tags_without performs negation and that lucene_query overrides other parameters, though the baseline is already 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 it searches Open Food Facts using Lucene query syntax with full boolean logic. It distinguishes from the sibling tool 'search_products_standard' by highlighting unique capabilities like negation and filter-only browsing.

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 explicitly lists four scenarios where this tool should be used instead of the standard alternative, and also details trade-offs such as approximate counts and sync delay, providing clear decision guidance.

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/domdomegg/openfoodfacts-mcp'

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