Skip to main content
Glama

Upsert Items

upsert_items
DestructiveIdempotent

Create or update catalog items by SKU (max 500 per call) — the direct seeding path for catalogs that don't arrive via import_historical_sales_orders or a channel sync, and the way to enrich existing items. Besides cost, price, barcodes and type, a row can set the built-in attributes: dimensions (length/width/height/diameter + dimensionUom), weight + weightUom, volume + volumeUom, cartonQuantity, tags, preferredLocation (bin), listPrice, shortDescription, note, taxable, salesTaxRate, isBackorderAllowed, isECommerceAvailable, manufacturingLeadTimeDays, launchDate and carryingCostPerUnitPerMonth. Use these rather than creating custom fields for the same facts. Whether an item is built, bought or transferred is not an item field: an item with a primary bill of materials is built (set_bill_of_materials), any other is bought, and a Transfer-mode warehouse is stocked by transfer (set_warehouse_supply_route). A bought item is ordered from defaultSupplierId, or at a warehouse listed in warehouseSuppliers from that warehouse's supplier (reorder POs, reorder-point lead time, reorder list). Identity is the SKU within the credential's client namespace; matching is case-insensitive. Existing items are preserve-on-omit — omitted fields keep their current values; supplied upcs REPLACE the barcode list. New items default to type=inventory and the tenant's default tax/UoM; missing standard UoMs (Each/oz/lb/fl oz/in/ft) are bootstrapped automatically (reported via uomsCreated). An optional per-row imageUrl (absolute http/https, default port only) downloads and sets the item's main product image, replacing any current one; image failures are reported per-row via imageStatus and never fail the row. Image downloading for the whole call is time-budgeted: once it is spent, later rows still create/update but report imageStatus=failed — resubmit those rows in a smaller batch. Set validateOnly=true first to get every row's would_create/would_update/invalid verdict without writing — including the one tenant-level create blocker (no tax rate configured; fix it with upsert_tax_rates) — then re-call without it to apply. An optional per-row customFields map (see list_custom_fields, entity=item) writes tenant-defined field values; an unknown fieldName fails just that row. Partial success: valid rows land even when siblings fail; resubmitting is safe (the upsert converges). A client-pinned credential seeds its own client's namespace; an operator credential on a 3PL tenant passes clientId to name the target client.

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": {
      "items": "<items>"
    },
    "name": "upsert_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesItem rows to create/update (max 500). sku is required per row.
clientIdNoOperator (unpinned) credentials on 3PL tenants: the target client id (GUID) the rows belong to — get ids from list_clients. Client-pinned credentials omit this; the credential decides.
validateOnlyNotrue = dry-run: validate + probe every row and report would_create/would_update per row, writing nothing. Recommended before the first real call.

Output Schema

NameRequiredDescriptionDefault
rowsNo
totalNo
failedNo
createdNo
updatedNo
uomsCreatedNo
validateOnlyNo
enabledCustomersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / items / items / properties / replenishmentType
      Removed value: -{
      -  "description": "How the item is replenished: manufacture | purchase. Decides whether a reorder recommendation becomes a production order or a purchase order. Omit to preserve.",
      -  "type": [
      -    "string",
      -    "null"
      -  ]
      -}
    • addedInput schema / properties / items / items / properties / warehouseSuppliers
      Added value: +{
      +  "items": {
      +    "properties": {
      +      "supplierId": {
      +        "description": "A live supplier ID from list_suppliers the item is bought from at this warehouse; null clears it, so the warehouse buys from the item's defaultSupplierId.",
      +        "format": "uuid",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "warehouseId": {
      +        "description": "A live warehouse ID from list_warehouses.",
      +        "format": "uuid",
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (idempotentHint, destructiveHint, openWorldHint), the description discloses preserve-on-omit semantics, that supplied upcs REPLACE the barcode list, that imageUrl replaces the current image, the per-call image time budget with resubmit guidance, partial success on row failures, and safe resubmission. These are exactly the mutation consequences an agent cannot infer from the hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the body is a dense, enumeration-heavy block that lists many attributes already present in the schema. Every clause contains information, yet the density makes it harder to parse than necessary; trimming the field list would improve scannability without losing semantics.

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

Completeness5/5

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

Output schema exists, so return values needn't be explained, and the description still covers auth/credential scoping (pinned vs. operator clientId), defaults for new items, UoM bootstrapping, the tenant-level create blocker, and partial-failure behavior. Nothing material for a destructive, idempotent upsert is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents most row fields, so heavy lifting is done structurally. The description still adds meaning the schema does not carry — preserve-on-omit semantics, case-insensitive SKU identity within the client namespace, the 500-row cap, and clientId vs. pinned credentials — though much of the field enumeration duplicates the schema.

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?

The description opens with a specific verb + resource + scope: 'Create or update catalog items by SKU (max 500 per call).' It then explicitly distinguishes this from import_historical_sales_orders and channel sync, so an agent can tell which path applies 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 Guidelines5/5

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

It routes the agent to alternatives with conditions attached: use built-in attributes rather than custom fields, use set_bill_of_materials for built items, set_warehouse_supply_route for transfers, list_custom_fields for tenant fields, and upsert_tax_rates to fix the one create blocker. It also prescribes calling with validateOnly=true first and then re-calling to apply.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources