Skip to main content
Glama

update_stock

Idempotent

Set a product's stock quantity and enable stock management for it, or target a specific variation by passing variation_id.

Instructions

Set a product's stock quantity and turn on stock management for it. Pass variation_id to set one variation of a variable product. Needs WC_ALLOW_WRITES=true.

Input Schema

NameRequiredDescriptionDefault
quantityYes
product_idYes
variation_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover readOnlyHint=false, idempotentHint=true, destructiveHint=false, so safety is largely handled. The description still adds two facts annotations cannot express: the call flips stock management ON as a side effect, and it requires the WC_ALLOW_WRITES flag to be enabled. Return behavior is left to the output 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, zero filler, with the core action stated first and the conditional parameter note and prerequisite following. Nothing repeats schema or annotation content.

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 3-parameter mutation with an output schema and full annotation coverage, the description supplies the prerequisite and the hidden side effect, which is what an agent most needs. It stops short of explaining edge cases such as quantity 0 versus stock status, or what happens if stock management was already on.

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 description coverage is 0%, so the description must carry the load, and it does the important part: it explains variation_id's purpose (targeting one variation of a variable product) and the word 'Set' implies absolute assignment rather than an increment. product_id and quantity semantics are only implied by their names, leaving minor gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Set a product's stock quantity') plus a non-obvious side effect ('turn on stock management for it'). It does not name or distinguish itself from any sibling, though the siblings are all reads (list_products, get_product, low_stock_report), so the write/read split is inferable rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives conditional guidance for one parameter ('Pass variation_id to set one variation of a variable product') and a prerequisite ('Needs WC_ALLOW_WRITES=true'). It never says when to prefer this over low_stock_report or get_product, and offers no when-not guidance.

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