Skip to main content
Glama

Adjust Stock

adjust_stock
Destructive

Record a stock count, add stock, or remove stock at a managed warehouse — the Inventory page's Adjust, Add and Remove actions. Each line is one item at one location: mode=count sets that location's on-hand to the counted quantity; mode=add adds units at a unit cost (defaults to the item's cost); mode=remove takes units out (damage, shrinkage, samples) and posts the inventory-decrease accounting entry. Added stock releases backordered sales-order lines. Tracked items need their lot, expiry or serials. The preview shows each location's on-hand and available before and after. Two-step: preview=true, then commit with the previewReceipt. For opening-stock seeding use set_inventory_levels; to receive a purchase order use receive_purchase_order. Max 100 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": {
      "lines": "<lines>"
    },
    "name": "adjust_stock"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesStock lines (max 100). All lines commit together or not at all.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview 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. Client-pinned credentials omit this.
warehouseIdNoInternal warehouse id (GUID) from list_warehouses. May be omitted when the tenant has exactly one Internal warehouse.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2: the receipt returned by the preview call. Supply with a fresh idempotencyKey to commit.

Output Schema

NameRequiredDescriptionDefault
okNo
linesNo
appliedNo
previewNo
warningsNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive=true, idempotentHint=false and readOnlyHint=false, and the description adds substantial behavior beyond that: atomic all-or-nothing line commits, the mandatory previewReceipt + fresh idempotencyKey commit flow, the accounting inventory-decrease entry posted on remove, backordered sales-order release on add, lot/expiry/serial requirements for tracked items, and the 100-line cap. Explicitly noting 'Nothing is written until the commit call' is exactly the kind of context a destructive tool needs.

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 purpose and mode semantics are front-loaded, and nearly every sentence carries operational information (atomicity, alternatives, limits, tracking requirements). It is dense to the point of being slightly overpacked in the opening sentence, and the mode explanations partially duplicate the schema, but there is no filler.

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-line, two-phase write tool this is complete: it covers atomicity, the preview/commit contract, idempotency, accounting side effects, tracking-field prerequisites and a line limit. An output schema exists, yet the description still tells the agent what the preview will show (on-hand and available before/after), closing the remaining gap.

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 description coverage is 100%, so both top-level and nested line parameters are already fully documented, including mode strings, quantity constraints and unitCost defaulting to baseline 3. The description restates the mode semantics and unit-cost default rather than adding new meaning, though it usefully clarifies that location is optional per mode via the schema rather than in prose.

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 ('Record a stock count, add stock, or remove stock at a managed warehouse') and pins it to concrete UI actions (Adjust, Add, Remove). It immediately distinguishes the three modes and names the sibling tools it is not (set_inventory_levels, receive_purchase_order), so an agent can route correctly without opening the 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?

Usage is explicitly scoped: mode=count/add/remove each get a stated purpose ('damage, shrinkage, samples' for remove), and two alternatives are named with the condition that selects them ('For opening-stock seeding use set_inventory_levels; to receive a purchase order use receive_purchase_order'). The two-step preview-then-commit procedure is also spelled out as required.

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