price-change-attribution
Attribute a total's change to quantity, price, FX, added and removed lines (sums exactly) — Explains why a total moved between two versions of a quote, order or invoice (up to 300 lines each), for an agent that must say how much of the change came from quantity, unit price, exchange rate, new lines and dropped lines. Lines are matched by key. Matched lines are decomposed by sequential substitution in the declared factor order (default quantity, then price, then fx), so the effects sum to
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": {
"before": "<before>",
"after": "<after>"
},
"name": "price-change-attribution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fx | No | Multiplier from line currency to reporting currency, before and after. Default 1 and 1. | |
| after | Yes | ||
| order | No | Substitution order of the factors; each at most once. Default [quantity, price, fx]. | |
| before | Yes | ||
| currency | No | ISO 4217 alphabetic code, upper case. | |
| exponent | No | ||
| rounding | No | 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. | |
| statedAfterTotal | No | Optional stated total of `after` to verify. | |
| statedBeforeTotal | No | Optional stated total of `before` (reporting currency) to verify. |