# The six tools

Six tools, named and shaped after the Universal Commerce Protocol shopping service (`source/services/shopping/mcp.openrpc.json`). They are not yet schema-validated against the UCP JSON schemas. Variant ids look like `mouser:<sku>` or `digikey:<sku>`. One distributor per checkout.

### search_catalog

Search components by MPN or keyword across Mouser and DigiKey, priced at your own distributor account (one install is one company). Every match comes back with its manufacturer: an MPN can be made by several, and they are never merged into one row.

- `catalog.query`: MPN or keyword
- `catalog.filters.categories`: optional list
- `catalog.pagination.limit`: 1 to 50

### get_product

Product detail: stock, minimum order quantity, order multiple and price breaks at your pricing.

- `catalog.id`: an MPN or a variant id
- `catalog.manufacturer`: optional, for an MPN that more than one manufacturer makes

An MPN that resolves to more than one manufacturer is not guessed. The tool returns the error `ambiguous_mpn` with `manufacturers` and every matching offer (variant id, stock, minimum order quantity, price). Repeat the call with `catalog.manufacturer`, or use a variant id.

### create_checkout

Create a checkout from variant ids and quantities.

- `checkout.line_items[]`: each with `item.id`, optional `item.manufacturer` and `quantity` (integer, 1 or more)

A bare MPN that more than one manufacturer makes is refused with `ambiguous_mpn`, as above; add `item.manufacturer` or use a variant id. A quantity that is not a multiple of the part's order multiple (for example a 12000 piece reel) is refused with `invalid_quantity_multiple` and a `suggested_quantity`, the next valid one.

### update_checkout

Replace the line items and re-price. Use it after a failed re-quote. The same rules as create_checkout apply.

- `id`: the checkout id
- `checkout.line_items[]`: as above

### complete_checkout

Place the order. Over your approval threshold it waits for a human.

- `id`: the checkout id
- `meta["idempotency-key"]` or an `Idempotency-Key` header: required

Over the threshold the checkout reports `complete_in_progress` and the order is `pending_approval`. Poll `get_order`.

### get_order

Order state, including `pending_approval` and `confirmed`, and the distributor's order number.

- `id`: the order id


Source: https://bomhq.com/docs/tools.md
