Find a product by barcode
find_by_barcodeLook up a catalog or user food product by EAN/UPC barcode and return it for adding or measuring. If no match, search by product name instead.
Instructions
Find the catalog product with a barcode (the EAN or UPC digits printed under the bars), or the user's own product with it (create_food's barcode). Returns it in the same shape as a search_food hit, for add_food and get_food_measures. A barcode that no product has is not_found: then search_food by the product's name.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"barcode": "<barcode>"
},
"name": "find_by_barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode | Yes | The 8 to 14 digits, without spaces, e.g. '5901234123457'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No | describe_error() of what went wrong; docs/AGENTS.md, Results and errors. |