Skip to main content
Glama

Set Inventory Levels

set_inventory_levels
DestructiveIdempotent

Set ABSOLUTE on-hand inventory levels at an Internal (managed) warehouse — the opening-stock step of tenant onboarding, after import_historical_sales_orders has seeded the catalog. Each line sets the item's on-hand to the given quantity (not a delta) at the warehouse's default location, with a full audit trail and cost layers. Items not listed are left untouched, so chunking a large catalog across calls is safe, and re-sending the same levels is a no-op. Provide unitCost for items whose cost is unknown to Spark (e.g. seeded from order history) so COGS and carrying-cost math work. Max 500 lines per call.

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": {
      "levels": "<levels>"
    },
    "name": "set_inventory_levels"
  }
}

Input Schema

NameRequiredDescriptionDefault
levelsYesInventory levels to set (max 500 per call).
previewNoStep 1 of the required two-step write: set true to validate, resolve the identifiers, and receive a structured preview of the resolved absolute targets plus a single-use previewReceipt. Nothing is written until the commit call.
clientIdNoOptional client id (GUID) for operator (unpinned) credentials on 3PL tenants: confines SKU/UPC matching to that client's items — get ids from list_clients. Client-pinned credentials omit this; the credential decides.
warehouseIdNoOptional Internal warehouse id (GUID). May be omitted when the tenant has exactly one Internal warehouse.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
errorsNo
failedNo
appliedNo
previewNo
skippedNo
warningsNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo
projectionsPendingNo
skippedIdentifiersNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds real context beyond them: items not listed are left untouched, re-sends are a no-op, an audit trail and cost layers are created, and cost-unknown items need unitCost for COGS math. That is substantive behavioral disclosure, not a restatement of hints.

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?

The definition is front-loaded with the absolute-vs-delta distinction and the onboarding context before the operational details. It is a dense single paragraph where nearly every clause carries information, though it could be broken into shorter sentences for scanability.

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?

For a destructive multi-parameter write with an output schema present, the description covers scope, side effects, idempotency, batching limits, and the required preview/commit flow. Nothing an agent needs to invoke it safely is missing, and return values are covered by the output schema.

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%, so the schema carries the parameter burden and the baseline is 3. The description still adds meaning beyond it by explaining why unitCost matters (items seeded from order history land with cost 0) and by justifying the batching constraint on levels.

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 states a specific verb and resource ('Set ABSOLUTE on-hand inventory levels at an Internal (managed) warehouse') and immediately clarifies the semantics ('not a delta'), which separates it from delta-style siblings such as adjust_stock. It also situates the call in a workflow ('opening-stock step of tenant onboarding').

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 names the preceding step explicitly ('after import_historical_sales_orders has seeded the catalog') and gives operational conditions: chunking large catalogs across calls is safe, re-sending is a no-op, and max 500 lines per call. The two-step preview/commit requirement is stated in the description and reinforced by the schema.

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