{"id":"mass-add","version":"1.0.0","description":"Add mixed-unit canonical integer mass amounts and express the sum in a target unit as a reduced rational.","supported_operations":["mass add","add mass quantities","sum masses in mixed units"],"unsupported_operations":["mass multiply","average mass","density from mass and volume","troy or stone units","floating-point mass"],"semantics":["terms is an array of 1 to 32 objects, each with a canonical integer string value and a mass unit.","Units are exactly ng, ug, mg, g, kg, t, oz, and lb; t is the metric tonne, lb is avoirdupois, oz is 1/16 lb.","Each term is converted to nanograms as BigInt and the nanogram amounts are summed.","The sum is converted to the to unit as the reduced rational sum_ng / to_ng.","Negative term values are allowed; -0 canonicalizes to 0.","Unknown fields, unknown units, empty or overlong terms arrays, and reduced results over 1000 digits are rejected."],"limits":{"max_digits":1000,"max_terms":32},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["terms","to"],"properties":{"terms":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["value","unit"],"properties":{"value":{"type":"string","pattern":"^-?(0|[1-9][0-9]*)$","maxLength":1001},"unit":{"type":"string","enum":["ng","ug","mg","g","kg","t","oz","lb"]}}}},"to":{"type":"string","enum":["ng","ug","mg","g","kg","t","oz","lb"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["numerator","denominator"],"properties":{"numerator":{"type":"string","pattern":"^(0|-?[1-9][0-9]*)$"},"denominator":{"type":"string","pattern":"^[1-9][0-9]*$"}}},"examples":[{"input":{"terms":[{"value":"1","unit":"kg"},{"value":"500","unit":"g"}],"to":"g"},"output":{"numerator":"1500","denominator":"1"}}],"execute_url":"/v1/tools/mass-add/versions/1.0.0/execute"}