@cyanheads/openfoodfacts-mcp-server 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/AGENTS.md +6 -4
  2. package/CLAUDE.md +6 -4
  3. package/README.md +18 -16
  4. package/changelog/0.4.x/0.4.4.md +31 -0
  5. package/changelog/0.4.x/0.4.5.md +39 -0
  6. package/changelog/template.md +10 -3
  7. package/dist/mcp-server/tools/definitions/browse-taxonomy.tool.d.ts +1 -0
  8. package/dist/mcp-server/tools/definitions/browse-taxonomy.tool.d.ts.map +1 -1
  9. package/dist/mcp-server/tools/definitions/browse-taxonomy.tool.js +6 -5
  10. package/dist/mcp-server/tools/definitions/browse-taxonomy.tool.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/compare-products.tool.d.ts +14 -0
  12. package/dist/mcp-server/tools/definitions/compare-products.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/compare-products.tool.js +62 -18
  14. package/dist/mcp-server/tools/definitions/compare-products.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/get-product.tool.d.ts +31 -0
  16. package/dist/mcp-server/tools/definitions/get-product.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/get-product.tool.js +241 -85
  18. package/dist/mcp-server/tools/definitions/get-product.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/index.d.ts +79 -8
  20. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/search-products.tool.d.ts +42 -8
  22. package/dist/mcp-server/tools/definitions/search-products.tool.d.ts.map +1 -1
  23. package/dist/mcp-server/tools/definitions/search-products.tool.js +421 -151
  24. package/dist/mcp-server/tools/definitions/search-products.tool.js.map +1 -1
  25. package/dist/mcp-server/tools/read-source.d.ts +11 -3
  26. package/dist/mcp-server/tools/read-source.d.ts.map +1 -1
  27. package/dist/mcp-server/tools/read-source.js +29 -2
  28. package/dist/mcp-server/tools/read-source.js.map +1 -1
  29. package/dist/mcp-server/tools/record-metadata.d.ts +41 -0
  30. package/dist/mcp-server/tools/record-metadata.d.ts.map +1 -0
  31. package/dist/mcp-server/tools/record-metadata.js +61 -0
  32. package/dist/mcp-server/tools/record-metadata.js.map +1 -0
  33. package/dist/services/mirror/mirror-lock.d.ts +4 -3
  34. package/dist/services/mirror/mirror-lock.d.ts.map +1 -1
  35. package/dist/services/mirror/mirror-lock.js +4 -3
  36. package/dist/services/mirror/mirror-lock.js.map +1 -1
  37. package/dist/services/mirror/mirror-queries.d.ts +45 -22
  38. package/dist/services/mirror/mirror-queries.d.ts.map +1 -1
  39. package/dist/services/mirror/mirror-queries.js +109 -58
  40. package/dist/services/mirror/mirror-queries.js.map +1 -1
  41. package/dist/services/mirror/mirror-store.d.ts +8 -1
  42. package/dist/services/mirror/mirror-store.d.ts.map +1 -1
  43. package/dist/services/mirror/mirror-store.js +12 -1
  44. package/dist/services/mirror/mirror-store.js.map +1 -1
  45. package/dist/services/mirror/mirror-sync.js +7 -1
  46. package/dist/services/mirror/mirror-sync.js.map +1 -1
  47. package/dist/services/mirror/record-builder.d.ts +31 -11
  48. package/dist/services/mirror/record-builder.d.ts.map +1 -1
  49. package/dist/services/mirror/record-builder.js +222 -100
  50. package/dist/services/mirror/record-builder.js.map +1 -1
  51. package/dist/services/openfoodfacts/openfoodfacts-service.d.ts +155 -44
  52. package/dist/services/openfoodfacts/openfoodfacts-service.d.ts.map +1 -1
  53. package/dist/services/openfoodfacts/openfoodfacts-service.js +355 -119
  54. package/dist/services/openfoodfacts/openfoodfacts-service.js.map +1 -1
  55. package/dist/services/openfoodfacts/types.d.ts +79 -15
  56. package/dist/services/openfoodfacts/types.d.ts.map +1 -1
  57. package/dist/services/openfoodfacts/types.js +41 -0
  58. package/dist/services/openfoodfacts/types.js.map +1 -1
  59. package/dist/services/taxonomy/taxonomy-service.d.ts +70 -33
  60. package/dist/services/taxonomy/taxonomy-service.d.ts.map +1 -1
  61. package/dist/services/taxonomy/taxonomy-service.js +259 -102
  62. package/dist/services/taxonomy/taxonomy-service.js.map +1 -1
  63. package/dist/utils/until-cancelled.d.ts +11 -0
  64. package/dist/utils/until-cancelled.d.ts.map +1 -0
  65. package/dist/utils/until-cancelled.js +19 -0
  66. package/dist/utils/until-cancelled.js.map +1 -0
  67. package/package.json +7 -7
  68. package/server.json +3 -3
  69. package/skills/openfoodfacts-guide/SKILL.md +11 -10
package/AGENTS.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** openfoodfacts-mcp-server
4
- **Version:** 0.4.3
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
- **Engines:** Bun ≥1.4.0, Node ≥24.0.0
4
+ **Version:** 0.4.5
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
6
+ **Engines:** Bun ≥1.4.4, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
8
8
  **Zod:** ^4.6.7
9
9
 
@@ -218,8 +218,10 @@ src/
218
218
  taxonomy-service.ts # Tag vocabulary — live resolution, offline sample, merge/fallback policy, tag-value canonicalization
219
219
  utils/
220
220
  markdown.ts # Contextual Markdown escaping for crowd-sourced values in content[]
221
+ until-cancelled.ts # Wait on shared work as one caller: its answer, or that caller's own cancellation
221
222
  mcp-server/
222
223
  tools/read-source.ts # How tool text names an answer's source (off_api / off_mirror) and the mirror freshness note
224
+ tools/record-metadata.ts # Completeness label and the created / last-modified lines every product tool renders
223
225
  tools/definitions/
224
226
  get-product.tool.ts # off_get_product
225
227
  search-products.tool.ts # off_search_products
@@ -333,7 +335,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
333
335
 
334
336
  ## Bundling
335
337
 
336
- `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
338
+ `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs — `framework-skills/`, `skills/`, `.claude/`, `.agents/`, `AGENTS.md`, and `CLAUDE.md` at a package's root, and `SKILL.md` anywhere (a `skills/` deeper in a package is runtime code and stays); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
337
339
 
338
340
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
339
341
 
package/CLAUDE.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** openfoodfacts-mcp-server
4
- **Version:** 0.4.3
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.18`
6
- **Engines:** Bun ≥1.4.0, Node ≥24.0.0
4
+ **Version:** 0.4.5
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.22`
6
+ **Engines:** Bun ≥1.4.4, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.4.0
8
8
  **Zod:** ^4.6.7
9
9
 
@@ -218,8 +218,10 @@ src/
218
218
  taxonomy-service.ts # Tag vocabulary — live resolution, offline sample, merge/fallback policy, tag-value canonicalization
219
219
  utils/
220
220
  markdown.ts # Contextual Markdown escaping for crowd-sourced values in content[]
221
+ until-cancelled.ts # Wait on shared work as one caller: its answer, or that caller's own cancellation
221
222
  mcp-server/
222
223
  tools/read-source.ts # How tool text names an answer's source (off_api / off_mirror) and the mirror freshness note
224
+ tools/record-metadata.ts # Completeness label and the created / last-modified lines every product tool renders
223
225
  tools/definitions/
224
226
  get-product.tool.ts # off_get_product
225
227
  search-products.tool.ts # off_search_products
@@ -333,7 +335,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
333
335
 
334
336
  ## Bundling
335
337
 
336
- `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`framework-skills/`, `skills/`, `.claude/`, `.agents/`, `SKILL.md`); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, `CLAUDE.md`, `AGENTS.md`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
338
+ `bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. `mcpb pack` reads `.mcpbignore`, not `.gitignore`, so every root path the bundle must not ship — source, tests, docs, caches, logs, agent docs, plugin manifests, gitignored local files — needs a root-anchored line there (`/docs/`, never `docs/`, which also strips `node_modules/*/docs/`); `lint:packaging` names each missing or unanchored line. Root `skills/` ships on purpose. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips four classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs — `framework-skills/`, `skills/`, `.claude/`, `.agents/`, `AGENTS.md`, and `CLAUDE.md` at a package's root, and `SKILL.md` anywhere (a `skills/` deeper in a package is runtime code and stays); platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on; node-gyp build output beside a `binding.gyp` (`config.gypi`, Makefiles, `obj.target/`, `.deps/`, object files and debug symbols), which records the packing machine's paths — compiled `*.node` addons stay; and build-only package files — the framework's `changelog/`, `scripts/`, `templates/`, and config bases (`biome.json`, `vitest.config.base.mjs`, `config/tsconfig.base.json`), and `better-sqlite3`'s `deps/` and `src/` C sources. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
337
339
 
338
340
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
339
341
 
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.4.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openfoodfacts-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.4.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openfoodfacts-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openfoodfacts-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.4.5-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/openfoodfacts-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.4.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/openfoodfacts-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openfoodfacts-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.4-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -50,20 +50,22 @@ Packaged-food data from Open Food Facts, a crowd-sourced database of 3M+ product
50
50
 
51
51
  ### `off_get_product` <sub>tool</sub>
52
52
 
53
- - `barcode` is digits only, 4–40 digits after any leading zeros; optional `fields` trims the response and pulls in what a field depends on (`nutriments` brings the serving size, quantity, and unit, and `serving_quantity` and `serving_quantity_unit` each bring the other plus the serving size), with `requested_fields` echoing what was fetched
54
- - Returns ingredients (raw text plus a parsed tree up to three levels deep with `percent_estimate`), `allergens_tags`, `traces_tags`, `additives_tags`, `ingredients_analysis_tags` (vegan, vegetarian, palm-oil verdicts), `nutriscore_grade`, `nova_group`, `ecoscore_grade` (Green-Score), `nutriments` (per serving, and per 100 g, or per 100 ml for liquids), category/label/packaging/origin/country tags, `image_url`, and `completeness` (0–1)
53
+ - `barcode` is digits only, 4–40 digits after any leading zeros; optional `fields` trims the response and pulls in what a field depends on (`nutriments` brings the serving size, quantity, and unit, and `serving_quantity` and `serving_quantity_unit` each bring the other plus the serving size; `ingredients_text` and `ingredients_text_languages` each bring `lang`), with `requested_fields` echoing what was fetched
54
+ - Returns `product_name` and `generic_name` (what the product is, in its main language), ingredients (raw text in the record's main language, named by `lang`, which can be a contributor's translation; `ingredients_text_languages` with the text in every language entered; the `image_ingredients_url` and `image_nutrition_url` label photos to check it against; and a parsed tree up to three levels deep with `percent_estimate`), `allergens_tags`, `traces_tags`, `additives_tags`, `ingredients_analysis_tags` (vegan, vegetarian, palm-oil verdicts), `nutriscore_grade` with `nutriscore_score` (the points behind it, which rank products of one kind only), `nova_group`, `ecoscore_grade` (Green-Score) with `ecoscore_score`, `nutrient_levels` (Open Food Facts' low, moderate, or high for fat, saturated fat, sugars, and salt, with a `basis` of `as_sold` or `prepared` naming the figures it judged; `fields: ["nutrient_levels"]` brings `nutriments` for that reason), `nutriments` (per serving, and per 100 g, or per 100 ml for liquids; `carbohydrates_100g` and the separate `carbohydrates_total_100g`, which includes fiber, are different nutrients and never derived from each other), category/label/packaging/origin/country tags, `image_url`, `completeness` (it can exceed 1), and `last_modified` and `created` as ISO 8601 times
55
55
  - `traces_tags: ["en:none"]` means the label states no traces, while an empty array means none entered yet; a barcode no contributor has recorded fails as `not_found`
56
56
  - Open Food Facts returns one preparation state of the nutrition per read. A read of prepared-product figures puts them under keys ending in `_prepared` in `additional_100g` and `additional_serving`, and prints them in "as prepared" sections. When a read returns only prepared figures, one more product read fetches the single as-sold set the record stores (`/api/v3.5` `fields=nutrition.input_sets`) and fills the named as-sold fields per 100 g, or per 100 ml for liquids, with no as-sold per-serving figure; `nutriments.stored_as_sold` reports `read`, `none` (the record stores no usable set), or `unread` with a `reason`, an `error`, and, when the failure named a wait, `retryAfter` in whole seconds (the call itself still succeeds). Other reads send nothing extra
57
- - `source` (`off_api` or `off_mirror`) names where the product was read; a barcode a [local mirror](#local-export-mirror) holds is read from it with no upstream request, with `mirror_as_of` (the time up to which the copy reflects every product contributed or edited on Open Food Facts) and a `mirror_snapshot` note, and the stored as-sold set comes from the same stored record
57
+ - `source` (`off_api` or `off_mirror`) names where the product was read; a barcode a [local mirror](#local-export-mirror) holds is read from it with no upstream request, with `mirror_as_of` (the time up to which the copy reflects every product contributed or edited on Open Food Facts) and a `mirror_snapshot` note, and the stored as-sold set comes from the same stored record; a row the copy holds from before it stored a requested field reads live for it, and `mirror_fields_unread` names what a failed or empty live read left out
58
58
 
59
59
  ---
60
60
 
61
61
  ### `off_search_products` <sub>tool</sub>
62
62
 
63
- - `query` (up to 24 words, all of which must match the name, generic name, categories, labels, or brand; punctuation separates words, so `milk-chocolate` requires both) plus the tag filters `categories_tag`, `brands_tag`, `labels_tag` (up to 10), `allergens_tag`, `traces_tag`, `ingredients_analysis_tag`, `additives_tag`, `nutrition_grade`, `nova_group`, `countries_tag`, the `exclude_allergens` / `exclude_traces` lists (up to 14 each), and up to 18 `nutrient_filters` (per 100 g, or per 100 ml for liquids), all combined as AND; optional `sort_by`
64
- - `page_size` defaults to 20 and is served at up to 50 per call; a larger value, with no ceiling, is served at 50 and flagged in `page_size_capped`, and `page` counts pages of 50. Rows carry `barcode`, `product_name`, `brands`, `nutriscore_grade`, `nova_group`, `ecoscore_grade`, and `categories_tags`, plus `total`, `total_is_lower_bound`, `last_page`, `omitted`, and `truncated` (more matches beyond this page). Exclusions add `exclusion_coverage`, since products with no allergen data entered pass them; `nutrient_filters` add `indexed_nutriments` (the index values the filters checked, which can differ from `off_get_product`)
63
+ - `query` (up to 24 words, all of which must match the name, generic name, categories, labels, or brand; punctuation separates words, so `milk-chocolate` requires both) plus the tag filters `categories_tag`, `brands_tag`, `labels_tag` (up to 10), `allergens_tag`, `traces_tag`, `ingredients_analysis_tag`, `ingredients_tag` (up to 10, all of which must appear), `additives_tag`, `nutrition_grade`, `nova_group`, `ecoscore_grade` (Green-Score), `countries_tag`, the `exclude_allergens` / `exclude_traces` lists (up to 14 each), and up to 18 `nutrient_filters` (per 100 g, or per 100 ml for liquids), all combined as AND; optional `sort_by`
64
+ - `nutrition_grade`, `nova_group`, and `ecoscore_grade` each take one grade or an array matching any of them (`["a", "b"]` for Nutri-Score B or better), where a `labels_tag` array requires all of its values; `ecoscore_grade` `a` excludes `a-plus`. A grade filter never changes which backend answers; on a text search it matches the grades the index holds, which each row shows. A tag-only `ecoscore_grade` search matches the grade Open Food Facts files for France, while each row shows the world grade
65
+ - `page_size` defaults to 20 and is served at up to 100 per call; a larger value, with no ceiling, is served at 100 and flagged in `page_size_capped`, and `page` counts pages of 100. Rows carry `barcode`, `product_name`, `brands`, `quantity` (which tells pack sizes of one product apart), `nutriscore_grade`, `nova_group`, `ecoscore_grade`, `categories_tags`, `completeness`, and `last_modified` and `created` as ISO 8601 times (on a text search, the indexed revision's), plus `total`, `total_is_lower_bound`, `last_page`, `omitted`, and `truncated` (more matches beyond this page). Exclusions add `exclusion_coverage`, since products with no allergen data entered pass them; `nutrient_filters` add `indexed_nutriments` (the index values the filters checked, which can differ from `off_get_product`)
65
66
  - The text index compares `energy-kcal`, `fat`, `saturated-fat`, `carbohydrates`, and `sugars` as whole numbers (`sugars lte 3` returns a row at 3.53). A `nutrient_filters` search sends `gt` and `gte` on those five as `[floor(value) TO *]` so no match is lost, then checks every returned row against every constraint at the index's 32-bit precision. Rows that fail leave the page and count in `outside_constraints`, so a page can come back short or empty while later pages hold matches. `total`, `total_is_lower_bound`, and `last_page` describe the index's whole-number answer and still count those rows. A range inside one whole number (`sugars gt 3.9` and `lt 4`) can pass few of the 10,000 reachable rows; add `query` or tag filters to narrow it
66
- - `query` or `nutrient_filters` searches a text index that lags the live database (flagged in `text_index_snapshot`), reaches only the first 10,000 results, and rejects `additives_tag` as `additives_filter_needs_tag_search`; tag-only searches read the live database through page 10, unless a [local mirror](#local-export-mirror) serves them: with every tag value confirmed, a mirror-served search has an exact `total` and reaches its first 10,000 results. A page past any of these limits fails as `page_out_of_range`
67
+ - `ingredients_tag` takes canonical ingredient IDs (`en:inulin`; resolve one with `off_browse_taxonomy` facet `ingredients`, where IDs are singular), and each parsed ingredient also carries its taxonomy parents, so `en:vegetable` matches a product listing carrot. It is answered only by the text index, with or without `query`, since the mirror indexes no ingredients and the live tag path stops at page 10
68
+ - `query`, `nutrient_filters`, or `ingredients_tag` searches a text index that lags the live database (flagged in `text_index_snapshot` and dated by `text_index_as_of`, the time of the newest record the index holds, when this server could read it), reaches only the first 10,000 results, and rejects `additives_tag` as `additives_filter_needs_tag_search`; tag-only searches read the live database through page 10, unless a [local mirror](#local-export-mirror) serves them: with every tag value confirmed (a brand counts when the mirror holds products under its slug), a mirror-served search has an exact `total` and reaches its first 10,000 results, and one carrying `ecoscore_grade` is served only once a full reload of the mirror has indexed Green-Score. A page past any of these limits fails as `page_out_of_range`; for a brand the mirror holds no product under, page 11 or later sends one live count, which answers a page the live matches end before as empty with that total and refuses one they reach into, naming the brand and the live total
67
69
  - `source` (`off_api` or `off_mirror`) names where the answer was read; from the mirror it also carries `mirror_as_of` and a `mirror_snapshot` note, and the default order and `sort_by` `popularity_key` and `unique_scans_n` follow the values stored with each record, which can differ from a live search, which ranks by its current scan counts
68
70
 
69
71
  ---
@@ -71,18 +73,18 @@ Packaged-food data from Open Food Facts, a crowd-sourced database of 3M+ product
71
73
  ### `off_compare_products` <sub>tool</sub>
72
74
 
73
75
  - 2–100 `barcodes`, one row each in input order; repeated barcodes are compared once, and those past the 10th distinct one are listed in `unprocessed` without being fetched
74
- - Rows carry `found`, `nutriscore_grade`, `nova_group`, `ecoscore_grade`, energy, fat, saturated fat, carbohydrates, sugars, salt, protein, and fiber (per 100 g, or per 100 ml for liquids), and `completeness`; missing values stay absent, never imputed
76
+ - Rows carry `found`, `nutriscore_grade` and `nutriscore_score`, `nova_group`, `ecoscore_grade` and `ecoscore_score` (the points behind each grade; Nutri-Score points break a grade tie only between products of one kind), energy, fat, saturated fat, carbohydrates, `carbohydrates_total_100g` (total carbohydrates including fiber, a separate nutrient), sugars, salt, protein, and fiber (per 100 g, or per 100 ml for liquids), and `completeness`; missing values stay absent, never imputed
75
77
  - A read of prepared-product figures adds a `prepared` object on the row with the same columns, read from the `*_prepared_100g` keys and never substituted for an as-sold figure. A row whose read returned only prepared figures gets the same stored as-sold read as `off_get_product`, once every barcode's product read has settled, and reports it as `stored_as_sold` (`read`, `none`, or `unread`, which never moves the barcode into `failed`). A row with as-sold figures appears in the as-sold table, a row with `prepared` in the "as prepared" table, and a row with both appears in both
76
- - Each row carries `source` (`off_api` or `off_mirror`), and `mirror_as_of` for a row read from a [local mirror](#local-export-mirror), so one comparison can mix the two; a `mirror_snapshot` note appears when any row came from it
78
+ - Each row carries `source` (`off_api` or `off_mirror`), and `mirror_as_of` for a row read from a [local mirror](#local-export-mirror), so one comparison can mix the two; a `mirror_snapshot` note appears when any row came from it. A mirror row stored before the score points existed is served as stored with no live read, and `mirror_fields_unread` on the row names what it lacks
77
79
  - `not_found` lists barcodes with no contributor record and `failed` lists fetches that failed, each with a `reason` and, when the failure named a wait, `retryAfter` in whole seconds; a failed barcode gets no row and never blocks the rest
78
80
 
79
81
  ---
80
82
 
81
83
  ### `off_browse_taxonomy` <sub>tool</sub>
82
84
 
83
- - `facet` is one of `categories`, `labels`, `allergens`, `additives`, `countries`, `nova_groups`, `nutrition_grades`; `search` matches a substring of the tag ID, name, or a synonym ("shellfish" → `en:crustaceans`); `limit` (default 20) returns up to 200 per call, with no input maximum (a larger value returns the first 200); a cut result says how many matched; no paging. Each lookup asks for up to 2,000 suggestions, above the largest answer measured (1,313), so an E-number term such as `e314` resolves to `en:e314` and the match count is exact below that size
85
+ - `facet` is one of `categories`, `labels`, `allergens`, `additives`, `countries`, `ingredients`, `nova_groups`, `nutrition_grades`; `search` matches a substring of the tag ID, name, or a synonym ("shellfish" → `en:crustaceans`), and the tag the term itself names (`US` → `en:united-states`) is listed first; `limit` (default 20) returns up to 200 per call, with no input maximum (a larger value returns the first 200); a cut result says how many matched; no paging. Each lookup asks for up to 2,000 suggestions, above the largest answer measured (1,313), so an E-number term such as `e314` resolves to `en:e314` and the match count is exact below that size
84
86
  - Returns `tags[]` of `id` and `name`, where `id` goes to `off_search_products` unchanged; `nova_groups` and `nutrition_grades` come back complete with `total_in_facet`
85
- - The five open facets resolve against the live Open Food Facts taxonomy and fall back to a small offline sample, with a `notice`, when it is unavailable; omitting `search` returns only that sample
87
+ - The six open facets resolve against the live Open Food Facts taxonomy. Five fall back to a small offline sample, with a `notice`, when it is unavailable, and omitting `search` returns only that sample. `ingredients` has no sample: it lists nothing without a `search` or when the lookup fails, and its IDs are singular (`oat` resolves to `en:oat`, `oats` to nothing)
86
88
 
87
89
  ## Features
88
90
 
@@ -95,7 +97,7 @@ Open Food Facts-specific:
95
97
  - The stored as-sold read for a prepared-only product spends the product budget, so a barcode can take two product reads, and has its own 20 s deadline: a call settles within 35 s + 20 s = 55 s, and an unread set never fails the call or the row
96
98
  - Optional [local export mirror](#local-export-mirror) (`OFF_MIRROR_PATH`): barcode reads and confirmed tag-only searches served from a SQLite copy of the export, kept current by daily deltas; a result names its `source` and, from the mirror, the time it reflects
97
99
  - Nutriments normalized from hyphenated keys (`energy-kcal_100g` → `energy_kcal_100g`), with `additional_100g` / `additional_serving` maps that label each nutrient with its unit
98
- - Tag filters take canonical IDs (`en:organic`, `en:no-gluten`); on text searches a case variant, synonym, or brand name is canonicalized first (`US` → `en:united-states`)
100
+ - Tag filters take canonical IDs (`en:organic`, `en:no-gluten`); on text searches a case variant or synonym is canonicalized first (`US` → `en:united-states`), while `brands_tag` takes a brand name or slug, slugged the way Open Food Facts slugs it (`Nestlé` → `nestle`), with brand synonyms resolved only on a search that reads the live database
99
101
  - Every field is contributor-entered, so a missing one means not yet recorded, except that a product read returning only prepared-product nutrition is followed by a read of the as-sold figures the record stores, reported as `stored_as_sold`; Nutri-Score, NOVA, and Green-Score are Open Food Facts' own computed grades, returned as-is, and carry regional formula caveats
100
102
 
101
103
  Agent-friendly output:
@@ -140,7 +142,7 @@ No API key or account is needed: the server identifies itself to Open Food Facts
140
142
  |:---------|:------------|:--------|
141
143
  | `OFF_BASE_URL` | Open Food Facts API base URL. | `https://world.openfoodfacts.org` |
142
144
  | `OFF_RATE_LIMIT_PRODUCT` | Product read budget (requests/min). The default is Open Food Facts' published per-IP limit; lower it on a shared outbound IP. | `15` |
143
- | `OFF_RATE_LIMIT_SEARCH` | Search budget (requests/min). The default is Open Food Facts' published per-IP limit. | `10` |
145
+ | `OFF_RATE_LIMIT_SEARCH` | Search budget (requests/min). The default is Open Food Facts' published per-IP limit. The text index date probe behind `text_index_as_of` draws on it only while two slots are free, and each probe (at most one per 6 hours, or per 15 minutes while it keeps failing) counts against it. | `10` |
144
146
  | `OFF_RATE_LIMIT_TAXONOMY` | Taxonomy lookup budget (requests/min), shared by `off_browse_taxonomy`, tag canonicalization on text searches, and exclusion checks. | `10` |
145
147
  | `OFF_MIRROR_PATH` | Path of the [local export mirror](#local-export-mirror)'s SQLite file. Unset disables the mirror. Works from a source checkout or the Docker image only. | unset |
146
148
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
@@ -156,7 +158,7 @@ See [`.env.example`](./.env.example) for the full list of optional overrides.
156
158
 
157
159
  ### Local development
158
160
 
159
- Requires [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
161
+ Requires [Bun v1.4.4](https://bun.sh/) or higher (or Node.js v24+).
160
162
 
161
163
  - **Clone and install:**
162
164
 
@@ -196,7 +198,7 @@ The image defaults to HTTP transport, stateless session mode, and logs to `/var/
196
198
 
197
199
  #### Local export mirror
198
200
 
199
- Setting `OFF_MIRROR_PATH` keeps a local SQLite copy of the Open Food Facts export. `off_get_product` and `off_compare_products` read it first by barcode and read live for a barcode it lacks. A search by tag filters alone is served from it when every value is a confirmed tag or brand slug, with an exact `total` through its first 10,000 results; every other search is live. A store error falls through to a live read. The mirror scripts need a checkout or the Docker image, so the npm install and `.mcpb` bundle stay live-only.
201
+ Setting `OFF_MIRROR_PATH` keeps a local SQLite copy of the Open Food Facts export. `off_get_product` and `off_compare_products` read it first by barcode and read live for a barcode it lacks. A search by tag filters alone is served from it when every value is a confirmed tag and a brand is one the copy holds products under, with an exact `total` through its first 10,000 results, a search carrying `ecoscore_grade` only once a full reload has indexed Green-Score; every other search is live. A product read of a row not yet rewritten by that reload is live too for any requested field the row lacks (`generic_name`, `nutrient_levels`, the ingredient languages, the score points, and the label photos); should that read fail or find no product, the row answers without them and `mirror_fields_unread` says why. `off_compare_products` stays on the mirror through a reload and serves such a row as stored, its `mirror_fields_unread` naming the fields it lacks. Record dates come from the row at any record version. A store error falls through to a live read. The mirror scripts need a checkout or the Docker image, so the npm install and `.mcpb` bundle stay live-only.
200
202
 
201
203
  In the image, mount a volume at the store directory, `/usr/src/app/.mirror`, set `OFF_MIRROR_PATH` to a file in it, and build the store once with `docker exec`:
202
204
 
@@ -212,7 +214,7 @@ docker exec openfoodfacts-mcp-server bun run mirror:verify # status plus SQLit
212
214
  docker exec openfoodfacts-mcp-server bun run mirror:refresh # one delta pass by hand
213
215
  ```
214
216
 
215
- A full `mirror:init` of the 4.9M-product export took about 1 h 48 min in testing, peaked at about 27 GB on the volume while the 13.4 GB download sat beside the store, left a 14.3 GB store, and used under 350 MB of memory. Reads stay live until `mirror:init` completes. Once `OFF_MIRROR_PATH` is set the server refreshes the mirror itself every three hours, at minute 30 of the server's local time: it applies each new daily delta, and reloads the whole export when the last full load is 30 days old and the export has changed since, because deltas never report deleted products. An export or delta line that is not valid JSON, or runs past 16 MiB, is skipped and logged by line number, and `mirror:status` prints how many the last full load skipped. An export that builds no product at all is refused before it deletes anything (`export_no_products`): the mirror keeps serving what it holds, and each refresh downloads the export again, applying no delta, until an export that lists products replaces it. While a reload runs, `mirror_as_of` can drop below the last delta's end, to a time the rewritten products reflect, until the load completes and the deltas re-apply. `mirror:status` and `mirror:verify` exit non-zero unless a sync has completed and the store holds products. From a checkout, run the same `bun run mirror:*` scripts with `OFF_MIRROR_PATH` set in `.env`.
217
+ A full `mirror:init` of the 4.9M-product export took about 1 h 48 min in testing, peaked at about 27 GB on the volume while the 13.4 GB download sat beside the store, left a 14.3 GB store, and used under 350 MB of memory. Reads stay live until `mirror:init` completes. Once `OFF_MIRROR_PATH` is set the server refreshes the mirror itself every three hours, at minute 30 of the server's local time: it applies each new daily delta, and reloads the whole export when the last full load is 30 days old and the export has changed since, because deltas never report deleted products, and whenever the last full load was built by an older record version, which a release changing what a record holds bumps. An export or delta line that is not valid JSON, or runs past 16 MiB, is skipped and logged by line number, and `mirror:status` prints how many the last full load skipped. An export that builds no product at all is refused before it deletes anything (`export_no_products`): the mirror keeps serving what it holds, and each refresh downloads the export again, applying no delta, until an export that lists products replaces it. While a reload runs, `mirror_as_of` can drop below the last delta's end, to a time the rewritten products reflect, until the load completes and the deltas re-apply. `mirror:status` and `mirror:verify` exit non-zero unless a sync has completed and the store holds products. From a checkout, run the same `bun run mirror:*` scripts with `OFF_MIRROR_PATH` set in `.env`.
216
218
 
217
219
  ## Project structure
218
220
 
@@ -0,0 +1,31 @@
1
+ ---
2
+ summary: "Grade filters take one value or a list and gain a Green-Score filter, off_search_products filters by ingredient, off_get_product returns generic_name and nutrient_levels, pages hold up to 100 results, and off_browse_taxonomy lists the tag a term names first."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.4 — 2026-11-08
8
+
9
+ ## Added
10
+
11
+ - **`nutrition_grade`, `nova_group`, `ecoscore_grade`** ([#85](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/85)): `off_search_products` takes one value or an any-of array for each, and `ecoscore_grade` (Green-Score) is a new filter. The mirror serves grade lists exactly and indexes Green-Score from record version 2, so a Green-Score search is served from it only after a full reload has indexed it.
12
+ - **`off_get_product` `generic_name` and `nutrient_levels`** ([#87](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/87)): what the product is, and Open Food Facts' low/moderate/high verdict on fat, saturated fat, sugars, and salt, with `basis` (`as_sold` or `prepared`) naming the figures it describes.
13
+ - **`mirror_fields_unread`** ([#87](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/87)): an `off_get_product` read asking for `generic_name` or `nutrient_levels` from a mirror row that predates them goes live; if that read fails or finds nothing, the stored row is served without them and this output field names which were not read and why.
14
+ - **`ingredients_tag` and the `ingredients` facet** ([#88](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/88)): `off_search_products` filters on canonical ingredient IDs, answered from the text index, and refuses `additives_tag`. `off_browse_taxonomy` `facet: "ingredients"` resolves them, live only, with no offline sample.
15
+
16
+ ## Changed
17
+
18
+ - **`page_size` cap 50 → 100** ([#86](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/86)): pages count at the size served, so `page_size: 100` with `page: 101` (results 10,001–10,100) is refused as `page_out_of_range`, where 0.4.3 served `page: 101` as results 5,001–5,050 at its cap of 50.
19
+ - **Mirror record version 2** ([#87](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/87)): a mirror runs a full reload of the export on its next refresh, even when the export is unchanged. Until that reload completes, a full `off_get_product` read of a row it has not yet rewritten reads live, spending a product lookup, and a tag-only search carrying `ecoscore_grade` reads live, so a page past 10 is refused as `page_out_of_range` naming `ecoscore_grade`.
20
+ - **`text_index_snapshot`** ([#85](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/85)): a text-path search carrying a grade filter says the grades are the index's, single grades included.
21
+ - **Green-Score label**: the `off_get_product` scores line and the `off_compare_products` Scores table label the grade "Green-Score", where they said "Eco-Score".
22
+
23
+ ## Fixed
24
+
25
+ - **`off_browse_taxonomy` `search`** ([#84](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/84)): the tag the term itself names (`US` → `en:united-states`) is listed first, and is added when the substring rule admits neither its ID nor its name (`plant based milk alternatives`), so a small `limit` no longer cuts it.
26
+
27
+ ## Dependencies
28
+
29
+ - **`@cyanheads/mcp-ts-core`** ^0.13.18 → ^0.13.22. The mirror sync hands the framework's runner a store without its own `syncLease`, keeping every page write behind the server's mirror lock, and a connection dropped mid-body, now reported as a wrapped network error, still maps to the retryable `upstream_error`.
30
+ - **`engines.bun`** >=1.4.0 → >=1.4.4 (the framework's SQLite mirror store requires it).
31
+ - **`@biomejs/biome`** ^2.6.4 → ^2.6.6, **`vitest`** ^5.0.5 → ^5.1.0.
@@ -0,0 +1,39 @@
1
+ ---
2
+ summary: "off_get_product returns the ingredients text in every language with the label photos, score points, and record dates; off_search_products rows add quantity, completeness, and dates and the text index is dated; brand names with accents match; total carbohydrates are reported as their own nutrient."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.5 — 2026-11-24
8
+
9
+ ## Added
10
+
11
+ - **`lang`, `ingredients_text_languages`, `image_ingredients_url`, `image_nutrition_url`** ([#91](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/91)): `off_get_product` names the record's main language, returns the ingredients text in every language entered (empty entries left out), and links the ingredients and nutrition photos to check it against. All four are `fields` values, and `ingredients_text` and `ingredients_text_languages` each bring `lang`.
12
+ - **`nutriscore_score`, `ecoscore_score`** ([#93](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/93)): the points behind each grade, on `off_compare_products` rows and `off_get_product`, printed beside the grade (`b (1)`). Nutri-Score points rank products of one kind only. In an `off_get_product` `fields` subset each brings its grade.
13
+ - **`quantity`, `completeness`** ([#92](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/92)): on every `off_search_products` row.
14
+ - **`last_modified`, `created`** ([#96](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/96)): ISO 8601 record times on `off_search_products` rows and `off_get_product`, and `fields` values there. A text-search row carries the indexed revision's.
15
+ - **`text_index_as_of`** ([#95](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/95)): the time of the newest record in the text index, on `off_search_products` answers the index served. `text_index_snapshot` names it; with no date it keeps its undated wording.
16
+ - **`mirror_fields_unread` on `off_compare_products` rows**: a row served from a mirror row that predates the score points names the fields it lacks. The comparison sends no live read for them; `off_get_product` reads them.
17
+
18
+ ## Changed
19
+
20
+ - **Mirror record version 3**: a mirror-backed server fully reloads its store on its next refresh. Until the reload reaches a product, a full `off_get_product` read of it goes live for the fields the older row lacks, while `off_compare_products` stays on the mirror and names them in `mirror_fields_unread`. Stored products grow about 10% (mean 4,387 → 4,829 bytes in the fixture sample).
21
+ - **Text index date probe**: a text search beside its own request reads the index date, at most one probe per 6 hours (per 15 minutes while it keeps failing), drawing on the `OFF_RATE_LIMIT_SEARCH` budget only while two slots are free.
22
+ - **`brands_tag` on the mirror** ([#94](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/94)): a tag-only search is served from the mirror only for a brand it holds products under; any other brand reads live. For such a brand, `page` 11 or later sends one live count: matches that end before the page answer it empty with that total, and matches that reach into it fail as `page_out_of_range` naming the brand and the live total.
23
+
24
+ ## Fixed
25
+
26
+ - **Total carbohydrates** ([#90](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/90)): a record holding only `carbohydrates-total` no longer reads as Carbohydrates `N/A`, and Sugars and Saturated fat no longer nest under a parent line the record lacks. `carbohydrates_total_100g` is its own `off_get_product` nutriment and `off_compare_products` column, never derived from `carbohydrates_100g`; on `off_get_product` the per-100 g figure moves there from `additional_100g.carbohydrates_total`.
27
+ - **`brands_tag`** ([#94](https://github.com/cyanheads/openfoodfacts-mcp-server/issues/94)): a brand name is slugged as Open Food Facts slugs it (`Nestlé` → `nestle`, `Meßmer` → `messmer`), where an accent returned an exact zero; brand synonyms resolve only on a search reading the live database.
28
+ - **Mirror serving size**: a household measure with a mass in brackets (`1/2 cup (60 g)`) reads back in the mass's unit, as a live read does, and a spoon or glass alone parses as Product Opener's units table reads it (`1 tbsp` is 15 ml).
29
+ - **Record times**: `last_modified` and `created` are omitted for a time at or before the epoch, never reported as one.
30
+ - **`completeness`**: a numeric string Open Food Facts stored (`"0.65"`) is read as the number.
31
+ - **Singular totals**: a total of 1 reads "1 total product" and "1 matching product exists".
32
+ - **Empty-result line**: it no longer points every search at `off_browse_taxonomy`; a brand-only search is pointed at `query`, since the taxonomy holds no brands.
33
+ - **Page 11 or later refusal**: an unconfirmed value's recovery hint goes by why it went unconfirmed: a value no tag matches is to be corrected or dropped, and one whose lookup failed is to be retried.
34
+ - **Brands and taxonomy values ending in Σ**: a text search sends an unconfirmed one under both IDs as one OR group, so `categories_tag: "EL:ΧΥΜΌΣ"` with a nutrient filter finds the 2 products filed under `el:χυμός`. Such a value and its `σ`-typed twin no longer share one cached taxonomy lookup.
35
+
36
+ ## Dependencies
37
+
38
+ - **`@biomejs/biome`** ^2.6.6 → ^2.6.8, **`better-sqlite3`** ^13.0.3 → ^13.2.0, **`ignore`** ^7.0.14 → ^7.0.16, **`vitest`** ^5.1.0 → ^5.1.1.
39
+ - The Bun test lane runs Vitest's threads pool (`vitest.config.ts`), since the fork pool needs a `channel.unref()` Bun lacks.
@@ -116,14 +116,21 @@ security: false
116
116
  resolves to whatever real item already owns 42, and timeline previews pull
117
117
  in that unrelated item's metadata.
118
118
 
119
+ Outside reporters: when the issue or PR came from outside the project
120
+ (`git-wrapup` step 5 says how to tell), thank its author in the same
121
+ parenthetical, profile linked by full URL for the same reason:
122
+
123
+ ([#38](https://github.com/cyanheads/mcp-ts-core/issues/38), thanks [@octocat](https://github.com/octocat)!)
124
+
119
125
  TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
120
126
  via `gh release create --notes-from-tag`. It is a condensed digest of this
121
127
  entry, never a copy, and its format is owned by the `release-and-publish`
122
128
  skill (step 4, "Create the annotated tag"): a short subject line without the
123
129
  version, flat headline bullets — no Keep-a-Changelog section headers, no
124
- gates line — at most one deps line, issue backlinks, and the changelog link
125
- last. In release-PR mode the `git-wrapup` skill authors those bullets as the
126
- PR body's `## Changes` and the tag copies them.
130
+ gates line — at most one deps line, issue backlinks with any outside-reporter
131
+ thanks, and the changelog link last. In release-PR mode the `git-wrapup`
132
+ skill authors those bullets as the PR body's `## Changes` and the tag copies
133
+ them.
127
134
  -->
128
135
 
129
136
  ## Added
@@ -9,6 +9,7 @@ export declare const offBrowseTaxonomyTool: import("@cyanheads/mcp-ts-core").Too
9
9
  allergens: "allergens";
10
10
  categories: "categories";
11
11
  countries: "countries";
12
+ ingredients: "ingredients";
12
13
  labels: "labels";
13
14
  nova_groups: "nova_groups";
14
15
  nutrition_grades: "nutrition_grades";
@@ -1 +1 @@
1
- {"version":3,"file":"browse-taxonomy.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-taxonomy.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAUjD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EA6KhC,CAAC"}
1
+ {"version":3,"file":"browse-taxonomy.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-taxonomy.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAUjD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;EA8KhC,CAAC"}
@@ -12,7 +12,7 @@ import { mdInline, mdInlineCode } from '../../../utils/markdown.js';
12
12
  const TAXONOMY_LIMIT_CAP = 200;
13
13
  export const offBrowseTaxonomyTool = tool('off_browse_taxonomy', {
14
14
  title: 'Browse Food Facts Taxonomy',
15
- description: 'Resolve a human term to the canonical Open Food Facts tag ID that off_search_products filters on. Covers categories, labels/certifications, allergens, additives, countries, NOVA groups, and Nutri-Score grades. Pass a search term to resolve against the Open Food Facts vocabulary, which holds tens of thousands of tags; omitting it returns only a small reference list for each facet except NOVA groups and Nutri-Score grades, which are complete. Most tag IDs use the "en:" prefix (e.g. "en:organic", "en:no-gluten", "en:crustaceans"); NOVA groups return bare digits "1"-"4" and Nutri-Score grades bare letters "a"-"e". Pass the id through to off_search_products exactly as returned. Category tags are frequently plural ("kombucha" resolves to "en:kombuchas"), so use the returned id rather than constructing one.',
15
+ description: 'Resolve a human term to the canonical Open Food Facts tag ID that off_search_products filters on. Covers categories, labels/certifications, allergens, additives, countries, ingredients, NOVA groups, and Nutri-Score grades. Pass a search term to resolve against the Open Food Facts vocabulary, which holds tens of thousands of tags; omitting it returns only a small reference list for each facet except NOVA groups and Nutri-Score grades, which are complete, and ingredients, which has no reference list and returns nothing. Most tag IDs use the "en:" prefix (e.g. "en:organic", "en:no-gluten", "en:crustaceans"); NOVA groups return bare digits "1"-"4" and Nutri-Score grades bare letters "a"-"e". Pass the id through to off_search_products exactly as returned. Category tags are frequently plural ("kombucha" resolves to "en:kombuchas") and ingredient tags singular ("oat" resolves to "en:oat", "oats" to nothing), so use the returned id rather than constructing one.',
16
16
  annotations: {
17
17
  readOnlyHint: true,
18
18
  idempotentHint: true,
@@ -26,14 +26,15 @@ export const offBrowseTaxonomyTool = tool('off_browse_taxonomy', {
26
26
  'allergens',
27
27
  'additives',
28
28
  'countries',
29
+ 'ingredients',
29
30
  'nova_groups',
30
31
  'nutrition_grades',
31
32
  ])
32
- .describe('"categories" covers food categories (en:cheeses, en:breakfast-cereals). "labels" covers certifications (en:organic, en:fair-trade). "allergens" covers declared allergens (en:milk, en:gluten). "additives" covers E-numbers (en:e322). "countries" covers country-of-sale tags (en:france). "nova_groups" and "nutrition_grades" are closed vocabularies returned complete; the other five are resolved against the Open Food Facts taxonomy.'),
33
+ .describe('"categories" covers food categories (en:cheeses, en:breakfast-cereals). "labels" covers certifications (en:organic, en:fair-trade). "allergens" covers declared allergens (en:milk, en:gluten). "additives" covers E-numbers (en:e322). "countries" covers country-of-sale tags (en:france). "ingredients" covers the ingredients Open Food Facts parses from ingredient lists (en:inulin, en:oat); it has no reference list, so pass a search term. "nova_groups" and "nutrition_grades" are closed vocabularies returned complete; the other six are resolved against the Open Food Facts taxonomy.'),
33
34
  search: z
34
35
  .string()
35
36
  .optional()
36
- .describe('Term to resolve. Matched case-insensitively as a substring of the tag ID, the display name, or a common synonym of either ("shellfish" resolves to en:crustaceans, "gluten free" to en:no-gluten). A single word works best ("hummus", not "hummus dip"). Omit only to see a small reference list — Open Food Facts cannot list the full vocabulary without a term, so an unfiltered call is not a view of the full facet.'),
37
+ .describe('Term to resolve. Matched case-insensitively as a substring of the tag ID, the display name, or a common synonym of either ("shellfish" resolves to en:crustaceans, "gluten free" to en:no-gluten); the tag the term itself names leads the list even when neither its ID nor its name contains the term as typed ("plant based milk alternatives" → en:plant-based-milk-alternatives). A single word works best ("hummus", not "hummus dip"). Omit only to see a small reference list (none for ingredients) — Open Food Facts cannot list the full vocabulary without a term, so an unfiltered call is not a view of the full facet.'),
37
38
  // `.int()` would advertise a `maximum` of 2^53 - 1 for a value the handler clamps to the cap.
38
39
  limit: z
39
40
  .number()
@@ -46,7 +47,7 @@ export const offBrowseTaxonomyTool = tool('off_browse_taxonomy', {
46
47
  })
47
48
  .min(1)
48
49
  .default(20)
49
- .describe(`Maximum entries to return (default 20). One call returns at most ${TAXONOMY_LIMIT_CAP}: a larger value returns the first ${TAXONOMY_LIMIT_CAP} and, when more matched, says how many did. There is no offset or page input: Open Food Facts offers no cursor for this lookup, so narrow the search term rather than paging. The tag spelling the term itself (e.g. "lentil" → en:lentils) is listed first among the live matches, so it is not the one a small limit cuts.`),
50
+ .describe(`Maximum entries to return (default 20). One call returns at most ${TAXONOMY_LIMIT_CAP}: a larger value returns the first ${TAXONOMY_LIMIT_CAP} and, when more matched, says how many did. There is no offset or page input: Open Food Facts offers no cursor for this lookup, so narrow the search term rather than paging. The tag the term itself names (e.g. "lentil" → en:lentils, "US" → en:united-states) is listed first, so it is not the one a small limit cuts.`),
50
51
  }),
51
52
  output: z.object({
52
53
  facet: z.string().describe('The facet name that was queried (echoes the input).'),
@@ -69,7 +70,7 @@ export const offBrowseTaxonomyTool = tool('off_browse_taxonomy', {
69
70
  notice: z
70
71
  .string()
71
72
  .optional()
72
- .describe(`Caveat about the answer — that the listing is a limited reference list rather than the full vocabulary, that the live vocabulary went unchecked and why (unreachable or no usable answer, Open Food Facts rate-limiting this server, or this server's own taxonomy budget spent, with the wait in seconds when one is known), that nothing matched and why, or that the limit cut matches, naming how many matched and the next call: a larger limit while one would list more, otherwise a narrower term, which is the only route past the first ${TAXONOMY_LIMIT_CAP} (a limit above ${TAXONOMY_LIMIT_CAP} is named too).`),
73
+ .describe(`Caveat about the answer — that the listing is a limited reference list rather than the full vocabulary, or that ingredients, which has none, needs a search term, that the live vocabulary went unchecked and why (unreachable or no usable answer, Open Food Facts rate-limiting this server, or this server's own taxonomy budget spent, with the wait in seconds when one is known), that nothing matched and why, or that the limit cut matches, naming how many matched and the next call: a larger limit while one would list more, otherwise a narrower term, which is the only route past the first ${TAXONOMY_LIMIT_CAP} (a limit above ${TAXONOMY_LIMIT_CAP} is named too).`),
73
74
  truncated: z.boolean().optional().describe('True when more tags exist beyond the limit.'),
74
75
  shown: z.number().optional().describe('Number of tags returned.'),
75
76
  cap: z
@@ -1 +1 @@
1
- {"version":3,"file":"browse-taxonomy.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-taxonomy.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAc,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,YAAY,E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,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAC9B,6FAA6F;YAC7F,wEAAwE;YACxE,KAAK,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,KAAK,CAAC,IAAI,CACR,qKAAqK,CACtK,CAAC;QAEF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"browse-taxonomy.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-taxonomy.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;GAGG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC/D,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,y8BAAy8B;IAC38B,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IAED,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,IAAI,CAAC;YACJ,YAAY;YACZ,QAAQ;YACR,WAAW;YACX,WAAW;YACX,WAAW;YACX,aAAa;YACb,aAAa;YACb,kBA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AC;IAC7D,CAAC;CACF,CAAC,CAAC"}
@@ -6,6 +6,15 @@ import { z } from '@cyanheads/mcp-ts-core';
6
6
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
7
7
  import { type StoredAsSoldRead } from '../../../services/openfoodfacts/openfoodfacts-service.js';
8
8
  import { type RawProduct } from '../../../services/openfoodfacts/types.js';
9
+ /** The `nutriscore_score` output field's description, one for both product tools. */
10
+ export declare const NUTRISCORE_POINTS_DESCRIPTION = "Nutri-Score points behind nutriscore_grade, Open Food Facts' own ranking: lower is better, and the grade is read off them. They rank products of one kind only: beverages, and fats, oils, nuts, and seeds, are graded on their own thresholds, so the same points can carry different grades across kinds. Absent when Open Food Facts computed none (never derived from the grade), or when mirror_fields_unread names it as not read.";
11
+ /** The `ecoscore_score` output field's description, one for both product tools. */
12
+ export declare const GREEN_SCORE_POINTS_DESCRIPTION = "Green-Score points behind ecoscore_grade: the world score, higher meaning lower environmental impact (\"a\" from 75, \"a-plus\" from 90), and bonuses can take it past 100. Absent when Open Food Facts computed none (never derived from the grade), or when mirror_fields_unread names it as not read.";
13
+ /**
14
+ * A grade as the text shows it, with the points behind it when the read carried them: `b (1)`.
15
+ * Points that came without a grade sit beside `N/A`, so neither surface drops them.
16
+ */
17
+ export declare function gradeWithPoints(grade: string | undefined, points: number | undefined): string;
9
18
  /** The failure reasons this tool declares — the four the service raises for a product fetch. */
10
19
  declare const FAILURE_REASONS: readonly ['upstream_error', 'upstream_timeout', 'upstream_rejected', 'rate_limited'];
11
20
  type FailureReason = (typeof FAILURE_REASONS)[number];
@@ -55,10 +64,13 @@ export declare const offCompareProductsTool: import("@cyanheads/mcp-ts-core").To
55
64
  brands: z.ZodOptional<z.ZodString>;
56
65
  found: z.ZodBoolean;
57
66
  nutriscore_grade: z.ZodOptional<z.ZodString>;
67
+ nutriscore_score: z.ZodOptional<z.ZodNumber>;
58
68
  nova_group: z.ZodOptional<z.ZodNumber>;
59
69
  ecoscore_grade: z.ZodOptional<z.ZodString>;
70
+ ecoscore_score: z.ZodOptional<z.ZodNumber>;
60
71
  prepared: z.ZodOptional<z.ZodObject<{
61
72
  carbohydrates_100g: z.ZodOptional<z.ZodNumber>;
73
+ carbohydrates_total_100g: z.ZodOptional<z.ZodNumber>;
62
74
  energy_kcal_100g: z.ZodOptional<z.ZodNumber>;
63
75
  fat_100g: z.ZodOptional<z.ZodNumber>;
64
76
  fiber_100g: z.ZodOptional<z.ZodNumber>;
@@ -83,7 +95,9 @@ export declare const offCompareProductsTool: import("@cyanheads/mcp-ts-core").To
83
95
  off_mirror: "off_mirror";
84
96
  }>>;
85
97
  mirror_as_of: z.ZodOptional<z.ZodString>;
98
+ mirror_fields_unread: z.ZodOptional<z.ZodString>;
86
99
  carbohydrates_100g: z.ZodOptional<z.ZodNumber>;
100
+ carbohydrates_total_100g: z.ZodOptional<z.ZodNumber>;
87
101
  energy_kcal_100g: z.ZodOptional<z.ZodNumber>;
88
102
  fat_100g: z.ZodOptional<z.ZodNumber>;
89
103
  fiber_100g: z.ZodOptional<z.ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"compare-products.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-products.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAW3E,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,mCAAmC,CAAC;AAiI3C,gGAAgG;AAChG,QAAA,MAAM,eAAe,YACnB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,CACN,CAAC;AAEX,KAAK,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAqCtD;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBpF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,gBAAgB,GACrB;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,cAAc,EAAE,YAAY,CAAA;CAAE,CAgBvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;+BAkDjD;AA4HD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsajC,CAAC"}
1
+ {"version":3,"file":"compare-products.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/compare-products.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAY,MAAM,+BAA+B,CAAC;AAa3E,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,mCAAmC,CAAC;AAU3C,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,6aACkY,CAAC;AAE7a,mFAAmF;AACnF,eAAO,MAAM,8BAA8B,6SAC6P,CAAC;AAEzS;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG7F;AAuID,gGAAgG;A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