Skip to main content
Glama

Simpler.Asia

stock_item_adjust

Move stock in or out by id or item name, in one atomic write with its movements-ledger row: stock-out clamps at zero (never negative) and applied_quantity reports what actually moved. An unmatched name CREATES the item at quantity 0 first so the delivery still lands as an audited ledger row; a name matching multiple active items refuses with the candidate ids. Concurrent adjusts on the same item retry instead of losing a write. NEXT: stock_item_list to see the item's updated balance in the full inventory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoThe stock item id.
nameNoNo id? Resolve-or-create by item name: a unique active match resolves; an unknown name CREATES the item at quantity 0 and the adjustment lands as its first ledger row.
typeYes"in" | "out" — also accepts received/delivery/restock (→ in) and sold/used (→ out).
unitNo
notesNoFree-form note recorded on the movements-ledger row.
reasonNoWhy the stock moved — recorded on the movements-ledger row.
categoryNo
quantityYesWhole units — count whole units: 24 bags → 24 (the digit string "24" also works).
is_activeNo
item_nameNoAlias of name.
expiry_dateNo
occurred_atNoWhen the stock ACTUALLY moved (business time): "YYYY-MM-DD" or epoch milliseconds. Omitted = now. Backdated deliveries stay distinguishable from entry time.
sell_price_centsNo
cost_per_unit_centsNo
low_stock_thresholdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources