Skip to main content
Glama

set_item_stock_quantity

DestructiveIdempotent

Set an item's stock quantity to an absolute value, with optimistic locking that requires the current stock to equal the expected quantity, and an optional dry-run to preview before writing.

Instructions

Modifies merchant data. Set an item's stock to an ABSOLUTE quantity (not a delta).

Optimistic lock: refuses unless current stock equals expected_current_quantity. Bounds: 0 <= new_quantity <= 1_000_000. dry_run=True previews the PUT body (still performs one read to fetch current stock) and never writes. Requires INVENTORY_R and INVENTORY_W.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNo
item_idYes
new_quantityYes
expected_current_quantityYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Beyond the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=true), the description discloses the optimistic lock mechanism, the absolute vs delta distinction, the 0–1,000,000 quantity bounds, the dry_run side-effect (still performs a read), and the required INVENTORY_R/W permissions. This is rich behavioral context that the annotations alone do not provide.

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?

The description is compact and well-structured: a one-line summary followed by three bullet-like sentences covering lock, bounds, dry_run, and permissions. No filler; every sentence adds essential information.

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?

Despite having an output schema (presumably describing the response), the description covers all critical practical aspects: mutation semantics, safety lock, validation bounds, dry_run behavior, and required scopes. It is complete enough for an agent to invoke the tool correctly without external docs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry full parameter meaning. It explains that new_quantity must be within bounds, expected_current_quantity is used for the optimistic lock, and dry_run previews the PUT body without writing. These semantics go far beyond the bare schema fields.

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 names a specific verb ('Set') and resource ('item's stock'), and specifies the absolute quantity semantics, clearly distinguishing it from sibling tools like set_item_price_cents or update_item_name. The phrase 'ABSOLUTE quantity (not a delta)' removes ambiguity.

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?

The description provides strong usage context, including the optimistic lock condition, valid bounds, and the dry_run preview behavior. It implicitly contrasts with delta-based stock updates ('not a delta'), but it does not explicitly name alternative tools for incremental adjustments or other inventory operations. Overall, it clearly indicates when and how to use the tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SBolivarLoL/clover-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server