Skip to main content
Glama

Edit a supply item

inventory_update

Edits a supply item to rename it, change unit, category, threshold, or stock; use relative quantityDelta for restocks/usage or absolute quantity after a stocktake with version check.

Instructions

Edits one supply item: rename it, change unit, category or threshold, or change its stock. For stock use quantityDelta to add or subtract (restock or relative change, no version check) or quantity to set an absolute value after a stocktake; the absolute form requires expectedQuantity and expectedUpdatedAt from a fresh inventory_list and fails with 409 version_conflict if the item changed since, so read again and retry. To record that something was used up, prefer inventory_consume. Send only the fields to change; an empty update fails with empty_update. A rename to a name already in the flat fails with 409 inventory_item_duplicate. A change that moves the stock from above to at or below threshold puts the item on the shopping list. Returns the updated item; unknown ids give 404 item_not_found.

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": {
      "id": "<id>"
    },
    "name": "inventory_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId of the supply item to edit, from inventory_list.
nameNoNew display name. Must not match another item in the flat.
unitNoNew unit of measure for quantity and threshold.
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.
categoryNoNew category used to group the item.
quantityNoAbsolute stock to set in the item unit (stocktake correction). Requires expectedQuantity and expectedUpdatedAt. Do not combine with quantityDelta.
thresholdNoNew low-stock threshold in the item unit; stock at or below it counts as low.
quantityDeltaNoRelative stock change in the item unit: positive to restock, negative to use. Result is clamped to 0..9999. Do not combine with quantity.
expectedQuantityNoQuantity of the item as last read from inventory_list. Required when quantity is set; a mismatch gives 409 version_conflict.
expectedUpdatedAtNoupdatedAt of the item as last read from inventory_list, ISO 8601 with offset. Required when quantity is set; a mismatch gives 409 version_conflict.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.1.1
    • addedInput schema / properties / category / description
      Added value: +"New category used to group the item."
    • addedInput schema / properties / expectedQuantity / description
      Added value: +"Quantity of the item as last read from inventory_list. Required when quantity is set; a mismatch gives 409 version_conflict."
    • addedInput schema / properties / expectedUpdatedAt / description
      Added value: +"updatedAt of the item as last read from inventory_list, ISO 8601 with offset. Required when quantity is set; a mismatch gives 409 version_conflict."
    • addedInput schema / properties / id / description
      Added value: +"Id of the supply item to edit, from inventory_list."
    • addedInput schema / properties / name / description
      Added value: +"New display name. Must not match another item in the flat."
    • addedInput schema / properties / quantity / description
      Added value: +"Absolute stock to set in the item unit (stocktake correction). Requires expectedQuantity and expectedUpdatedAt. Do not combine with quantityDelta."
    • addedInput schema / properties / quantityDelta / description
      Added value: +"Relative stock change in the item unit: positive to restock, negative to use. Result is clamped to 0..9999. Do not combine with quantity."
    • addedInput schema / properties / threshold / description
      Added value: +"New low-stock threshold in the item unit; stock at or below it counts as low."
    • addedInput schema / properties / unit / description
      Added value: +"New unit of measure for quantity and threshold."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing the optimistic-concurrency contract (409 version_conflict, read again and retry), the empty_update failure, the inventory_item_duplicate 409 on rename, the 404 item_not_found, and the shopping-list side effect when stock crosses the threshold. Annotations already cover the safety profile, and the description still adds strong behavioral context; the only omission is whether repeated identical deltas are safe to retry blindly.

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?

Front-loads the verb, resource, and editable fields, then layers the stock-mode decision and error cases in a logical order. It is a dense single block of prose with many clauses; every sentence is informative, but readability would improve with light structuring.

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 10-parameter mutation with no output schema, the description covers return value ("Returns the updated item"), every error path, concurrency requirements, and side effects. Nothing an agent needs in order to call it correctly 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%, so the baseline is 3, but the description adds meaning the schema only implies: the delta form skips version checking while the absolute form enforces it, and the expected values must come from a fresh inventory_list. That reconciliation nuance is genuinely useful beyond the field-level docs.

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?

Opens with a specific verb and resource ("Edits one supply item") and enumerates the mutable facets: name, unit, category, threshold, stock. It explicitly distinguishes itself from inventory_consume, so the agent can route without opening either 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?

Gives explicit mode selection: quantityDelta for restock/relative change (no version check) versus quantity for absolute stocktake correction (requires expected* fields). It also names the preferred alternative ("prefer inventory_consume") for the consumption case, which is exactly the when-not guidance an agent needs.

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