Skip to main content
Glama

shopify_set_inventory

Destructive

Set available inventory for one Shopify location with compare-and-set protection; preview changes via dry run before applying verified updates.

Instructions

Set available inventory at one location using compare-and-set protection: compareQuantity must equal the current available quantity. Read inventory first (shopify_get resource inventory). dryRun:true (the default) checks and previews without changing anything.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
storeYes
dryRunNoTrue (the default) returns a before/after preview without changing anything in Shopify. Pass false, after the user authorizes this store and exact change, to apply it; the tool then reads the result back.
reasonNocorrection
quantityYes
locationIdYes
idempotencyKeyNo
compareQuantityYes
inventoryItemIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.0.1
    • removedInput schema / properties / confirm
      Removed value: -{
      -  "const": true,
      -  "description": "True only after authorization for this store and exact change.",
      -  "type": "boolean"
      -}
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "default": true,
      +  "description": "True (the default) returns a before/after preview without changing anything in Shopify. Pass false, after the user authorizes this store and exact change, to apply it; the tool then reads the result back.",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "store",
      -  "inventoryItemId",
      -  "locationId",
      -  "quantity",
      -  "compareQuantity",
      -  "confirm"
      -]New value: +[
      +  "store",
      +  "inventoryItemId",
      +  "locationId",
      +  "quantity",
      +  "compareQuantity"
      +]
  2. Addedv1.6.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, readOnly=false and openWorld=true, so the safety burden is partly lifted. The description adds genuinely useful mechanics beyond the annotations: compare-and-set semantics where compareQuantity must equal the live available quantity, and that dryRun defaults to true and previews without changing anything. It omits auth/store-authorization requirements and rate limits, so not a 5.

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 tight sentences that lead with the operation, then the safety constraint, then the preview default. No filler. Slightly dense in the middle clause but each sentence earns its place.

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

Completeness3/5

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

For a destructive, 8-parameter mutation with no output schema, the description covers the critical CAS contract and dry-run default, but leaves six parameters unexplained and says nothing about the read-back behavior after applying. Adequate but with clear gaps against the tool's complexity.

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 only 13%, far below the 50% threshold, so the description must compensate and only partly does. It clarifies the two highest-risk parameters (compareQuantity's CAS condition and dryRun's preview behavior), but store, quantity, locationId, reason, idempotencyKey and inventoryItemId are left entirely to the schema. Baseline 3 given the partial compensation against a real coverage gap.

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 ('Set available inventory') plus the resource and scope ('at one location'), and distinguishes itself from the read path by pointing at shopify_get. An agent can tell this apart from shopify_update_prices or shopify_update_product without opening a schema.

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 a clear prerequisite workflow: read current inventory via shopify_get first, then set with a matching compareQuantity. It also explains the default dryRun preview path. It does not name when NOT to use this tool or contrast it with sibling mutation tools, so it stops short of a 5.

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