{"id":"cas-number-validate","version":"1.0.0","description":"Validate a CAS Registry Number's position-weighted mod 10 check digit over its variable-length first segment.","supported_operations":["validate a cas number","check cas registry number check digit","is this cas rn valid","cas checksum validator","verify a chemical registry number","confirm a cas number format","does this chemical registry number pass its check digit"],"unsupported_operations":["looking up which chemical substance a CAS Registry Number actually identifies","generating a fresh, unused CAS Registry Number","accepting a leading zero in the first segment (never used in a real CAS RN)"],"semantics":["cas must match exactly: 2 to 7 digits not starting with '0', a literal '-', exactly 2 digits, a literal '-', exactly 1 digit (the check digit). Any deviation is reason wrong_format, checked first; every field is null in that case.","normalized and check_digit (the raw final digit) are populated whenever cas matches the shape, regardless of whether the check digit itself is correct; normalized equals cas unchanged.","Check digit: concatenate the first two groups (no hyphen) into a 4-9 digit string, reverse it, multiply each digit by its 1-based position in the reversed string (the digit immediately before the final hyphen has weight 1), sum the products, and take the result modulo 10. A mismatch is reason check_digit_mismatch.","valid is true only when the shape and the check digit both pass, in that order; only one reason is ever returned."],"limits":{"max_cas_bytes":12},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["cas"],"properties":{"cas":{"type":"string","minLength":1,"maxLength":12}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","normalized","check_digit"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"wrong_format","check_digit_mismatch"]},"normalized":{"type":["string","null"]},"check_digit":{"type":["string","null"],"minLength":1,"maxLength":1}}},"examples":[{"input":{"cas":"50-78-2"},"output":{"valid":true,"reason":null,"normalized":"50-78-2","check_digit":"2"}},{"input":{"cas":"7732-18-5"},"output":{"valid":true,"reason":null,"normalized":"7732-18-5","check_digit":"5"}}],"execute_url":"/v1/tools/cas-number-validate/versions/1.0.0/execute"}