Upsert Bills of Materials
upsert_bills_of_materialsCreate or replace bills of materials by finished-good SKU (max 500 per call) — the manufacturing seeding path. Each row is one finished good plus its COMPLETE component list (component SKU + quantity per unit, optional UoM/note/scrap); an existing BOM's components are replaced by the list, so resubmitting is safe (the upsert converges). The finished good and every component must already exist as items in the credential's namespace — nothing is auto-created; use upsert_items first (labor/overhead lines are items too, typically type=noninventory). Created BOMs are flagged primary so planning explodes them. Set validateOnly=true first to get every row's would_create/would_replace/invalid verdict without writing, then re-call without it to apply. Partial success: valid rows land even when siblings fail, with per-row errors naming the unresolved SKUs. A row reported partially_applied was written but didn't finish cleanly — re-send it to converge. Operator (unpinned) credentials on 3PL tenants pass clientId to resolve SKUs within that client's namespace.
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": {
"boms": "<boms>"
},
"name": "upsert_bills_of_materials"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| boms | Yes | BOM rows (max 500). finishedGoodSku and a non-empty components list are required per row. | |
| clientId | No | Optional client id (GUID) for operator (unpinned) credentials on 3PL tenants: resolves finished-good/component SKUs within that client's namespace — get ids from list_clients. Client-pinned credentials omit this; the credential decides. | |
| validateOnly | No | true = dry-run: validate + probe every row and report would_create/would_replace per row, writing nothing. Recommended before the first real call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | ||
| total | No | ||
| failed | No | ||
| created | No | ||
| replaced | No | ||
| validateOnly | No | ||
| partiallyApplied | No |