commerce.update_product
Updates an existing product or specific variants in store inventory (supports additive stockDelta and atomic bulk variantUpdates) with post-write persistence verification.
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": {
"siteId": "<siteId>",
"productId": "<productId>"
},
"name": "commerce.update_product"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Updated name | |
| size | No | Optional variant size | |
| color | No | Optional variant color | |
| price | No | Updated price | |
| stock | No | Updated stock count | |
| images | No | Updated images array | |
| siteId | Yes | MongoDB Site ID | |
| category | No | Updated category | |
| variants | No | List of variant objects with name, price, offerPrice, and stock | |
| productId | Yes | MongoDB Product ID | |
| offerPrice | No | Updated offer price | |
| stockDelta | No | Additive stock adjustment (e.g. +10) | |
| description | No | Updated description | |
| variantType | No | Type of variants (e.g. 'ram_storage', 'ram', 'storage', 'mobile', 'size', 'color', 'weight', 'flavor', 'custom') | |
| targetVariant | No | Optional specific variant selector | |
| variantUpdates | No | Atomic bulk multi-variant updates ({ targetVariant/color/size, stock?, stockDelta?, price? }) |