check_allergens
Check ingredients for EU FIC 1169/2011 allergen compliance.
Returns a detailed audit trace mapping each ingredient to its EU Annex II
allergen group with entry numbers and labels. The safety verdict is
deterministic — no LLM involvement in the decision — and is pinned by the
returned kb_version_hash.
Use check_all_eu_allergens=True for food labelling (detect all allergens).
Use restrictions=['dairy', 'gluten'] to check for specific user allergies.
Supplying neither runs the full 14-group Annex II scan and sets
defaulted_to_full_scan — the tool never reports "safe" without checking.
is_safe answers "was a supplied restriction violated?"; declared_allergens
answers "what is actually present?". Read both.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dish_name | No | Optional dish name for reporting context. | |
| session_id | No | Optional session identifier so repeated checks are stitched into one trajectory. | |
| ingredients | Yes | List of ingredient names (freeform or canonical IDs). Examples: ['butter', 'wheat_flour', 'eggs', 'peanut_butter'] | |
| operator_id | No | Optional audit identifier for the calling operator (letters, digits, hyphens; max 64 chars). Tags the check in the telemetry log. Defaults to 'anonymous'. | |
| restrictions | No | Allergen group IDs to check against user restrictions. Valid IDs: gluten, crustaceans, eggs, fish, peanuts, soy, dairy, tree_nuts, celery, mustard, sesame, sulphites, lupin, molluscs. If None and check_all_eu_allergens=True, reports all detected allergens. | |
| response_format | No | Response format: 'json' (default) for the machine-actionable payload, or 'text' for a human-readable report. | json |
| check_all_eu_allergens | No | If True, scans for all 14 EU Annex II allergens regardless of restrictions list. Use this for food labelling (declare all allergens present). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |