allocate
Split a money amount into parts that sum exactly to the total — Splits one signed amount into up to 500 parts by weights (or equal parts), in integer minor units of its currency, for an agent dividing a bill, a refund, a fee or a tax. Each share is rounded under the declared mode, then the leftover minor units are assigned by the declared remainder policy, so the parts always sum to the total exactly. Negative totals (refunds) are supported; zero-weight parts
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": {
"total": "<total>"
},
"name": "allocate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | No | Equal split into this many parts. | |
| total | Yes | Decimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats. | |
| weights | No | Non-negative decimal-string weights, e.g. ["1","1","2"] or percentages. Give weights or parts. | |
| currency | No | ISO 4217 alphabetic code, upper case. | |
| exponent | No | Override the ISO 4217 exponent; required for codes not on the list. | |
| rounding | No | Rounding of each share before the residual is moved. Default half-even. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity. | |
| remainder | No | largest-remainder (default): one unit at a time to the part with the largest rounding claim, ties to the lowest index. first / last: the whole residual to the first / last part with positive weight. |