Skip to main content
Glama

create_commerce_variant

Destructive

Add one variant to a product.

option_values must name every one of the product's options with a value that option allows — call set_commerce_product_options first. Fails with 409 if the combination already exists.

Args: project_id: The project ID. product_id: The product ID. option_values: JSON object mapping option name to value, e.g. {"Size":"M","Colour":"Black"}. sku: Variant SKU, unique within the product. price_amount: Variant price in the smallest currency unit. Leave -1 to inherit the product price. compare_at_amount: Struck-through price for this variant. Leave -1 to skip. currency: ISO currency code. Defaults to the product currency. image_url: Image shown when this variant is selected. weight_grams: Shipping weight in grams. Leave -1 to skip. requires_shipping: Whether this variant needs a shipping address. inventory_policy: deny blocks checkout at zero stock, continue allows overselling. Default deny. inventory_quantity: Starting stock for this variant. Leave -1 to skip.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skuNo
currencyNo
image_urlNo
product_idYes
project_idYes
price_amountNo
weight_gramsNo
option_valuesYes
inventory_policyNo
compare_at_amountNo
requires_shippingNo
inventory_quantityNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and openWorldHint=true, so the write nature is covered; the description adds real beyond-schema context: the 409 duplicate-combination failure, the required prior call to set_commerce_product_options, and the meaning of the -1 sentinel for optional amounts. It never addresses the destructiveHint=true annotation beyond the generic write framing, but the added failure/prerequisite detail is substantive.

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?

Purpose, prerequisite, and failure mode are front-loaded in the opening two sentences, and the Args block is well-organized one-line-per-parameter. Given 0% schema coverage the length is justified, though 'Leave -1 to skip' is repeated four times and could be stated once.

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 12-parameter mutation tool with an output schema (so return values need no explanation) and covering annotations, the description supplies the prerequisite, failure mode, and full parameter semantics. It omits which parameters are required and any permission/authorization expectations, but nothing essential to calling it correctly is missing.

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 carries the entire burden, and it does: every one of the 12 parameters is documented, including non-obvious conventions like -1 meaning 'inherit' or 'skip' for price_amount, compare_at_amount, weight_grams, and inventory_quantity, the deny/continue semantics of inventory_policy, the ISO currency default, and a concrete option_values JSON example. This is meaningfully richer than the bare schema.

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?

The first sentence gives a specific verb and resource with scope: 'Add one variant to a product.' The word 'one' implicitly separates it from the bulk sibling generate_commerce_variants, and the following lines clarify its prerequisite. It stops short of naming the alternative tool outright, so it is clear but not fully self-differentiating.

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?

It states an explicit prerequisite ('call set_commerce_product_options first') and a concrete failure condition ('Fails with 409 if the combination already exists'), which is strong context for invocation ordering. It does not say when to choose this over generate_commerce_variants or update_commerce_variant, so the alternative-selection guidance is only partial.

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