sum
Add an array of signed decimal numbers with precision for accounting, then round to any decimal places using Excel-style rounding.
Instructions
Sum an array of signed decimal numbers and round the result to a specified number of decimal places. Uses precise decimal arithmetic suitable for accounting and tax calculations. Rounding uses the 'round half away from zero' strategy (equivalent to Excel ROUND).
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": {
"values": "<values>",
"decimalPlaces": "<decimalPlaces>"
},
"name": "sum"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | Yes | Array of signed decimal numbers to sum (e.g. [1.00, -2.50, 3.89]) | |
| decimalPlaces | Yes | Number of decimal places to round the result to (e.g. 2 for 2 decimal places) |