Check or add a GS1 check digit
validate_gtinCheck the check digit of a UPC-A (12 digits), EAN-13 (13) or ITF-14 (14) number, or compute it for a number given without one (set symbology). Uses the GS1 mod-10 rule, as gookit.co/barcode-generator does. It checks the arithmetic only, not whether the number is registered with GS1.
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_gtin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Digits. Spaces are ignored. | |
| symbology | No | Needed to compute a missing check digit. Without it, the code is read as complete: 12 digits UPC-A, 13 EAN-13, 14 ITF-14. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| note | Yes | ||
| input | Yes | ||
| valid | No | Only when mode is validated. | |
| gtin14 | Yes | The complete number padded to 14 digits. | |
| complete | Yes | The number with the correct check digit. | |
| next_step | No | One line naming the Gookit product for the next step, such as printing labels. Not part of the result. | |
| symbology | Yes | ||
| check_digit_found | No | ||
| check_digit_expected | Yes |