Generate Price Book Profiles
generate_price_book_profilesSweep every item a price book's supplier can make and generate the sourcing profiles that make them quotable — the bulk version of upsert_item_sourcing_profile. For each candidate item it runs the deterministic pre-fill over the item's own custom field values; items whose every cost driver resolves get a profile created or updated, and the rest come back as gap rows naming the attribute that blocked them. RUNS AS A PREVIEW BY DEFAULT: the report is also the 'is my catalog priceable?' coverage diagnostic, so a bare call writes nothing and the coverage section ranks attributes by how many items they block. To actually write, pass dryRun=false, which requires the governed two-step: preview=true returns the report plus a single-use previewReceipt, then repeat with that receipt and a fresh idempotencyKey to commit. Writing is refused for a draft or archived book (a draft's attribute keys can still move, which would strand every spec saved now); previewing one is allowed and is the best way to see what activating it would make priceable. No AI is used — per-item AI inference stays one at a time.
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": {
"bookId": "<bookId>"
},
"name": "generate_price_book_profiles"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookId | Yes | The price book id (GUID) to sweep. | |
| dryRun | No | Preview only. TRUE BY DEFAULT: the sweep reports what it would create/update/skip and writes nothing. Pass false to write, which requires the governed two-step below. | |
| preview | No | Step 1 of the required two-step write (only with dryRun=false): set true to resolve the sweep and receive the full report plus a single-use previewReceipt. Nothing is written until the commit call. | |
| clientId | No | Optional 3PL client id (GUID) — sweeps ALL items for this client regardless of supplier linkage. Breaks the chicken-and-egg where items need a vendor link before they can get a profile. | |
| maxItems | No | Optional cap on items evaluated in one sweep. A larger candidate set is reported as truncated (candidateCount vs scanned), never silently sampled. | |
| 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. | |
| applyDefaultSupplier | No | When true and profiles are created, sets each item's DefaultSupplierId to the book's supplier so the vendor link and sourcing profile stay in sync. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| report | No | ||
| applied | No | ||
| preview | No | ||
| expiresAt | No | ||
| actionItemId | No | ||
| confirmation | No | ||
| correlationId | No | ||
| approvalResult | No | ||
| idempotencyKey | No | ||
| previewReceipt | No | ||
| idempotentReplay | No |