Set Bill of Materials
set_bill_of_materialsCreate or replace ONE finished good's bill of materials (finished good by item id or SKU) with the complete component list given: lines not in the list are removed. Components resolve by SKU in the finished good's client namespace and must already exist (labor/overhead lines are noninventory items); nothing is auto-created. The preview shows the BOM before and after with added, removed and changed lines. Preview first, then repeat identical arguments with previewReceipt and a fresh idempotencyKey. Requires Write + manufacturing.execute and the Manufacturing plan. To seed many BOMs at once use upsert_bills_of_materials. In-app assistants get a confirm card the user applies.
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": {
"finishedGood": "<finishedGood>",
"components": "<components>"
},
"name": "set_bill_of_materials"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Optional BOM note. Omit to keep the current note; an empty string clears it. | |
| preview | No | Step 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call. | |
| components | Yes | The complete component list (1–500 lines): component SKU and quantity per unit, optional uom, scrapPercentage, isOptional, note, isPhantom, subAssemblyBomId. | |
| finishedGood | Yes | The finished good's item id (GUID) or SKU. | |
| idempotencyKey | No | Caller-generated idempotency key; required with previewReceipt to commit. | |
| previewReceipt | No | Step 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| bomId | No | ||
| action | No | ||
| applied | No | ||
| preview | No | ||
| expiresAt | No | ||
| components | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |