Retrieve the `inventoryItemId` for a variant by querying `product.variants.inventoryItem.id` via the Admin GraphQL API.
Query `inventoryLevel` or `inventoryLevels` to get current `available` quantities at each location of interest.
Use the `inventorySetQuantities` mutation (introduced to replace older adjust/activate mutations) to set quantities by providing `inventoryItemId`, `locationId`, `quantity`, and a `reason` string.
Alternatively, use `inventoryAdjustQuantities` to perform relative adjustments (delta) rather than setting absolute quantities, which is safer for concurrent updates.
Confirm the mutation response includes updated `inventoryLevel.quantities` and check `userErrors` for any constraint violations.
To connect an inventory item to a new location before adjusting, call `inventoryActivate` with the `inventoryItemId` and `locationId` first.
Known gotchas
Setting absolute quantities with `inventorySetQuantities` while another process does concurrent adjustments can cause race conditions — use delta adjustments where possible.
An inventory item must be activated at a location (via `inventoryActivate`) before its quantity can be set or adjusted there; missing this step returns a user error.
Some inventory items (e.g., those managed by fulfillment services) may not allow direct quantity writes — check `inventoryItem.tracked` and the managing service.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp