Skip to main content
Glama

WritersLogic verifiable AI agents

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

NameRequiredDescriptionDefault
partsNoEqual split into this many parts.
totalYesDecimal string such as "-12.50" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats.
weightsNoNon-negative decimal-string weights, e.g. ["1","1","2"] or percentages. Give weights or parts.
currencyNoISO 4217 alphabetic code, upper case.
exponentNoOverride the ISO 4217 exponent; required for codes not on the list.
roundingNoRounding 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.
remainderNolargest-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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources