Preview Cost
preview_costPrice a what-if on a priced calculation without saving anything: move cost factors (a rate, a time allowance, the material price) or the lot size, and get the new cost sheet with the change per cost category. Use it to test a cheaper option before deciding. Free: it uses no calculation of the quota and changes nothing, not this calculation and not its costing environment. The part is re-priced by the same engine, so the answer is a price, not an estimate. A factor outside its allowed range is refused by name. By default it answers with a summary: the headline before and after, the change per cost category and only the cost lines that moved; pass detail='full' for the whole previewed cost sheet. To price the part for real, use quote_part. Read-only.
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": {
"calculation_id": "<calculation_id>"
},
"name": "preview_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | No | 'summary' (the default): the headline before and after, the change per cost category and only the cost lines that moved. 'full': the whole previewed cost sheet in cost_lines instead. | summary |
| lot_size | No | Lot size to price the what-if at. Omit to keep the calculation's own lot size. | |
| adjustments | No | The factors to move, as {factor_key: new_value}. The keys are the ones get_cost_breakdown shows on each cost line. Omit to re-price at another lot_size only. | |
| calculation_id | Yes | Id of a calculation, as upload_and_quote, quote_part or list_calculations return it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | detail='summary' only: the headline under the what-if. | |
| delta | No | Change per top-level cost category, new minus current. A category on only one side carries its whole amount, so a line that appears or disappears is visible rather than skipped. | |
| before | No | detail='summary' only: the priced calculation's headline. | |
| currency | No | ||
| guidance | Yes | ||
| lot_size | No | Lot size this preview was priced at. | |
| unit_cost | No | Cost per part under the adjustments — the manufacturing cost, on the same basis as the calculation's own unit cost, so the two are directly comparable. The offer price with your surcharges and mark-up on top is the sum of every top-level line in ``cost_lines``. | |
| cost_lines | No | The previewed cost sheet as a tree, same shape as get_cost_breakdown's. Empty under detail='summary'. | |
| reconciled | No | Whether every tier of the previewed sheet added up to the line above it. False means a tier was dropped rather than shown not adding up — read the amounts, not the missing tier. | |
| adjustments | No | The factor values this preview was priced at, echoed back. | |
| moved_lines | No | detail='summary' only: every cost line, at any depth, whose amount moved, each with its path in the tree. Top-level lines only when the calculation recorded no itemised sheet to compare. | |
| total_delta | No | Change in the cost per part against the priced calculation: new minus current, in the currency above. | |
| calculation_id | Yes |