{"id":"length-add","version":"1.0.0","description":"Add integer length terms in mixed units and return the exact sum in a chosen unit.","supported_operations":["length add","add length measurements","sum length terms into a unit"],"unsupported_operations":["more than 32 terms","nautical miles","floating-point lengths","mean of lengths"],"semantics":["terms is an array of 1 to 32 objects, each with a canonical integer value and a length unit.","Each term is converted to nanometers as a BigInt and those amounts are summed.","The nanometer sum is converted to the to unit as a reduced canonical rational.","Negative term values are allowed; input -0 is canonicalized to 0.","Input integers and the reduced numerator and denominator may have at most 1000 digits excluding sign."],"limits":{"max_digits":1000,"max_terms":32,"units":["nm","um","mm","cm","m","km","in","ft","yd","mi"]},"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":["nm","um","mm","cm","m","km","in","ft","yd","mi"]}}}},"to":{"type":"string","enum":["nm","um","mm","cm","m","km","in","ft","yd","mi"]}}},"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":"ft"},{"value":"6","unit":"in"}],"to":"in"},"output":{"numerator":"18","denominator":"1"}}],"execute_url":"/v1/tools/length-add/versions/1.0.0/execute"}