Skip to main content
Glama

update_product_inventory

Idempotent

Updates stock quantity for a ShopNex variant, with optional price or SKU changes; previews by default and commits only when confirm=true.

Instructions

Update stock quantity (and optional integer priceCents or SKU) on a ShopNex variant via PATCH /api/v1/admin/variants/{variantId}. Provide variantId, or productId for a single-variant product. Defaults to confirm=false (dry-run preview); pass confirm=true to apply the change. Requires write_products scope.

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": {
      "inventoryQuantity": "<inventoryQuantity>"
    },
    "name": "update_product_inventory"
  }
}

Input Schema

NameRequiredDescriptionDefault
skuNoOptional updated SKU code.
confirmNoSafety gate: false (default) previews the change without modifying the store; true commits the update.
productIdNoUUID of a single-variant product when variantId is not yet known; resolves the sole variant automatically.
variantIdNoUUID of the product variant to update.
priceCentsNoOptional updated variant price in integer cents (for example 2500 for 25.00).
inventoryQuantityYesNew non-negative stock quantity for the target variant.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=false, destructiveHint=false and idempotentHint=true. The description adds information the annotations don't carry: a dry-run is the default and changes only land with confirm=true, and the call requires write_products scope. It does not describe behavior when productId resolves to a multi-variant product, which would have pushed this higher.

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?

Three sentences, front-loaded with the primary action and resource before the identifier rules and the confirm gate. Every sentence carries operational weight; the parenthetical '(and optional integer priceCents or SKU)' is slightly clunky but not wasteful.

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

Completeness4/5

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

For a 6-parameter mutation with full schema coverage and no output schema, the description covers the essentials an agent needs: identity resolution, the dry-run default, how to commit, and the required scope. Only failure behavior (e.g. multi-variant productId, invalid SKU) is left unstated.

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%, so all six parameters are already documented, including the confirm safety gate and cents-based pricing. The description only restates the variantId/productId either-or relationship already implied by the schema, adding no format or edge-case detail beyond it. Baseline 3 applies.

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 ('Update stock quantity... on a ShopNex variant') and pins the mechanism to PATCH /api/v1/admin/variants/{variantId}. Against siblings that are all read/list tools (get_product, list_products, shop_analytics), the mutating nature alone makes it unmistakable.

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

Usage Guidelines4/5

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

Gives concrete routing rules: supply variantId, or productId when the product has a single variant and the variant ID isn't known. It also explains the two-step flow (confirm=false preview first, confirm=true to commit). It lacks explicit when-not-to-use cases or named alternatives, but the context needed to pick the right identifiers is present.

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