Skip to main content
Glama

Update a stock quantity

set_inventory_quantity
DestructiveIdempotent

Use this when someone asks to correct or update how much of a stock item their vet clinic has. Returns the item with its previous and new quantity; the number given replaces the stored one. Not for adding a new stock item.

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": {
      "inventoryItemId": "<inventoryItemId>",
      "quantity": "<quantity>",
      "expectedLastEditTime": "<expectedLastEditTime>"
    },
    "name": "set_inventory_quantity"
  }
}

Input Schema

NameRequiredDescriptionDefault
quantityYesThe quantity now in stock, in the item unit. It replaces the stored quantity; work out the total first when the user gives a change.
inventoryItemIdYesId of the stock item, from list_inventory_items.
expectedLastEditTimeYesThe lastEditTime from list_inventory_items. An item changed since then is refused.

Output Schema

NameRequiredDescriptionDefault
itemYes
statusYes
previousQuantityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, readOnlyHint=false, so the safety profile is covered structurally. The description adds real value by disclosing that the supplied number replaces the stored value and that previous and new quantities are returned. However, it does not mention the optimistic-concurrency refusal behavior (stale expectedLastEditTime), which is the main failure mode and is only documented in the schema.

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?

Three short sentences, front-loaded with the usage trigger, then the return/behavior, then the exclusion. No redundant restatement of the name or title and no 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?

With an output schema present, the description needn't detail return values, and it correctly confines itself to semantics and scoping. Complete enough for a 3-parameter mutation, with the only real gap being the concurrency-refusal behavior that lives in the schema rather than the description.

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 baseline is 3; the description earns above baseline by clarifying the replace-not-delta semantics of the quantity in prose ('the number given replaces the stored one'), reinforcing a genuine misuse risk that the schema also flags. It says nothing about expectedLastEditTime, leaving that to the schema.

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?

States a specific verb+resource (set the quantity of a stock item), and the title/description pair is unambiguous. It explicitly distinguishes itself from a sibling behavior by stating 'Not for adding a new stock item', which separates it from creation-related tools in the inventory workflow.

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 a clear situational trigger ('when someone asks to correct or update how much of a stock item their vet clinic has') and one explicit exclusion (not for creating a new item). It does not name the sibling tool to use instead for item creation, nor mention list_inventory_items as the prerequisite source of ids, though the schema does that.

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