Skip to main content
Glama

Generate Price Book Profiles

generate_price_book_profiles
DestructiveIdempotent

Sweep 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

NameRequiredDescriptionDefault
bookIdYesThe price book id (GUID) to sweep.
dryRunNoPreview 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.
previewNoStep 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.
clientIdNoOptional 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.
maxItemsNoOptional cap on items evaluated in one sweep. A larger candidate set is reported as truncated (candidateCount vs scanned), never silently sampled.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 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.
applyDefaultSupplierNoWhen 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

NameRequiredDescriptionDefault
okNo
reportNo
appliedNo
previewNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=true and idempotentHint=true; the description earns credit for adding non-obvious behavior the annotations cannot express — that the default path writes nothing, that writing is a two-step governed commit, and that draft/archived books are rejected because attribute keys can still move. It also indicates existing profiles can be updated and that blocked items return as gap rows naming the offending attribute. What it does not do is qualify the destructive profile beyond 'created or updated': it never says whether an existing profile's prior values are overwritten or merged, which is the main risk an agent needs to weigh before setting dryRun=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and the preview default, and the capitalized 'RUNS AS A PREVIEW BY DEFAULT' foregrounds the single most consequential fact. It is dense with em-dash asides and stacked parentheticals ('a draft's attribute keys can still move, which would strand every spec saved now'), costing some scannability, but no sentence is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an eight-parameter, destructive, gated-write tool this covers the full decision surface: what it sweeps, what gets written, what comes back for blocked items, how to commit, and which book states are refused. Since an output schema exists, the description is not obligated to enumerate return values, and its brief mention of gap rows and the coverage ranking is bonus context rather than load-bearing detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the per-parameter descriptions are already detailed (including defaults and the clientId chicken-and-egg rationale), so the schema does the heavy lifting and baseline 3 applies. The prose adds genuine cross-parameter meaning — the dryRun/preview/previewReceipt/idempotencyKey sequence as a single flow and maxItems reporting truncation rather than silently sampling — but individual parameter meaning is largely restated from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource — 'sweep every item a price book's supplier can make and generate the sourcing profiles' — and explicitly frames itself as 'the bulk version of upsert_item_sourcing_profile', naming the sibling it differs from. An agent can distinguish bulk-sweep from single-item upsert without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use routing against upsert_item_sourcing_profile, states that a bare call is preview-only and when to pass dryRun=false, and spells out the precondition that writing is refused for draft or archived books while previewing them is encouraged. The governed two-step sequence (preview receipt, then commit with fresh idempotencyKey) is stated as a required procedure rather than left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources