MCPInventory
Add inventory costs
distru-add-inventory-costsWriteAdds costs to one package, batch or product, spread over its quantity on hand.
Inputs
Every tool also takes the common inputs.
| Field | Type | Required | Description |
|---|---|---|---|
| packageId | string | No | Send exactly one of packageId, batchId or productId. Resolve via distru-search-packages. |
| batchId | string | No | A batch of a batch-tracked product. Resolve via distru-search-batches. |
| productId | string | No | A product-tracked product; package- and batch-tracked products take costs per package or batch. Resolve via distru-search-products. |
| locationIds | string[] | No | batchId or productId only: spread the costs over the stock at these locations only; default all. Resolve via distru-search-locations. |
| expectedQuantity | string or number | Yes | The record's quantity on hand as you last read it, in its unit type; refused when it has changed since. packageId: quantity from distru-get-package. batchId: quantity from distru-get-batch. productId: quantityActive from distru-get-product. With locationIds: the sum of those locations' activeQuantitiesByLocation. |
| costs | object[] | Yes | |
| costs[]. | string | Yes | Resolve via distru-search-lookups (type COST_TYPE). |
| costs[]. | string or number | Yes | Greater than 0, in the cost type's unit type. |
| costs[]. | string or number | No | Dollars per unit of the cost type's unit type. Defaults to the cost type's costPerUnit; refused when the cost type's allowInlineEdits is false. |
| costs[]. | string | No |
Output
This tool returns one of 3 shapes, depending on its inputs.
Presence on a nested field assumes its parent exists.
Result with package
| Field | Type | Presence |
|---|---|---|
| costs | object[] | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | enumASSEMBLYBIOTRACK_ADJUSTMENTBIOTRACK_MANIFEST_RECEIVEDBREAKDOWNCOST_ENTRYMETRC_ADJUSTMENTMETRC_TRANSFER_RECEIVEDOTHERPACKAGE_IMPORTPLANT_BATCH_PACKAGINGPURCHASE_ORDERSTOCK_ADJUSTMENT | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Always |
| costs[]. | enumPACKAGEBATCHPRODUCTHARVESTPLANTPLANT_BATCHMULTIPLE_PLANTSNONE | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| package | object | Always |
| package. | string | Always |
| package. | string | Always |
| package. | string | Always |
| package. | string | Can be null |
Result with batch
| Field | Type | Presence |
|---|---|---|
| costs | object[] | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | enumASSEMBLYBIOTRACK_ADJUSTMENTBIOTRACK_MANIFEST_RECEIVEDBREAKDOWNCOST_ENTRYMETRC_ADJUSTMENTMETRC_TRANSFER_RECEIVEDOTHERPACKAGE_IMPORTPLANT_BATCH_PACKAGINGPURCHASE_ORDERSTOCK_ADJUSTMENT | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Always |
| costs[]. | enumPACKAGEBATCHPRODUCTHARVESTPLANTPLANT_BATCHMULTIPLE_PLANTSNONE | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| batch | object | Always |
| batch. | string | Always |
| batch. | string | Always |
| batch. | string | Always |
| batch. | string | Can be null |
Result with product
| Field | Type | Presence |
|---|---|---|
| costs | object[] | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | enumASSEMBLYBIOTRACK_ADJUSTMENTBIOTRACK_MANIFEST_RECEIVEDBREAKDOWNCOST_ENTRYMETRC_ADJUSTMENTMETRC_TRANSFER_RECEIVEDOTHERPACKAGE_IMPORTPLANT_BATCH_PACKAGINGPURCHASE_ORDERSTOCK_ADJUSTMENT | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Always |
| costs[]. | enumPACKAGEBATCHPRODUCTHARVESTPLANTPLANT_BATCHMULTIPLE_PLANTSNONE | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | object | Can be null |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | object | Can be null |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | object | Always |
| costs[]. | string | Always |
| costs[]. | string | Always |
| costs[]. | string | Can be null |
| costs[]. | string | Can be null |
| product | object | Always |
| product. | string | Always |
| product. | string | Always |
| product. | string | Always |
| product. | string | Can be null |
What the AI reads
Adds costs to one package, batch or product, spread over its quantity on hand. Each cost adds costPerUnit × quantity to the record's total cost, not to each unit. Not idempotent: calling twice adds the costs twice. Distru cost accounting only; nothing is sent to Metrc. Returns the added costs in the get tools' cost breakdown shape, and the record with its total cost after the change: quantityCost (package) or activeQuantityCost (batch, product), not per unit; null when the caller cannot view costs.