Validate a barcode number (GTIN, EAN, UPC) or compute its check digit
validate_barcodeChecks the GS1 check digit of a GTIN-8 (EAN-8), GTIN-12 (UPC-A), GTIN-13 (EAN-13) or GTIN-14, returns the 14-digit form, and flags special prefix ranges (in-store codes, ISBN/ISSN, coupons). Set compute_check_digit to get the missing last digit for a number without one. Doesn't identify the product or company: GS1's registry isn't open.
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": {
"code": "<code>"
},
"name": "validate_barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Barcode digits, e.g. '4006381333931'. | |
| compute_check_digit | No | Treat the input as missing its check digit and compute it. |