Skip to main content
Glama

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.

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": {
      "type": "<type>",
      "quantity": "<quantity>"
    },
    "name": "stock_item_adjust"
  }
}

Input 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

A4.4/5.0
Behavior5/5

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

Discloses behavior far beyond the annotations: clamps stock-out at zero, reports applied_quantity for actual movement, creates a zero-quantity item on unmatched name, refuses on ambiguous multi-match with candidate ids, and retries on concurrency. The retry-on-conflict note is consistent with idempotentHint=false, and the item creation is consistent with destructiveHint=false.

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

Conciseness5/5

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

Every sentence carries non-obvious behavior: clamping, resolve-or-create, ambiguity refusal, retry, and the next step. Purpose is front-loaded and no sentence is filler.

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

Completeness4/5

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

For a 15-parameter mutation with no output schema, the description carries the important half: movement semantics, creation fallback, and even the applied_quantity return field. The gap is that the remaining item-attribute parameters' effect on auto-created items is unspecified.

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 53%, and the description covers only the high-value parameters (id, name resolution, type, quantity semantics). The remaining 11 fields — unit, category, cost_per_unit_cents, sell_price_cents, expiry_date, low_stock_threshold, is_active — get no explanation in either place, particularly how they apply when the item is auto-created.

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?

Specific verb+resource ("move stock in or out") plus the atomic ledger-row scope, with id-or-name addressing stated up front. An agent can distinguish this from stock_item_create/stock_item_update without opening any schema, since the write is framed as an audited movement rather than a record edit.

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 clear selector logic: id preferred, name as resolve-or-create fallback, and an explicit next step ("NEXT: stock_item_list"). It stops short of naming stock_item_update or stock_item_create as the alternative for non-movement edits, leaving that inference to the agent.

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