Skip to main content
Glama

Save variant

save_variant

Create or update an OPTION (size, colour, pack) under an existing product; for the product itself, use save_product. Pass an id to update it; omit id to create a new one. Returns the new variant id on create. To create/update many at once, send an items array — one all-or-nothing transaction with a single ledger recompute; each item with an id updates, each without creates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoVariant id. Present → update that variant; omit → create a new one.
skuNoStock-keeping unit / product code.
costNoCost price per unit.
nameNoDisplay name / description of the variant.
imageNoVariant image URL; pass "$delete" to remove the existing image.
itemsNoVector of variant objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates.
notesNoFree-text notes.
priceNoSelling price per unit, in the record's currency.
unitsNoUnit of measure label (e.g. "each", "hour", "kg").
barcodeNoBarcode value for this variant.
currencyNoISO 4217 currency code (e.g. "ZAR", "USD"). Defaults to the business currency.
productidNoParent product id this variant belongs to (see list_products).
descriptionNoVariant description.
salestaxidsNoSales tax ids to link to this variant.
costcurrencyNoISO 4217 currency code for the cost price.
salestaxexclusiveNoWhether the price excludes sales tax.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare this is a non-read-only, non-destructive write, so the safety profile is covered. The description adds genuinely new context: that create returns the new variant id, that a batch is one all-or-nothing transaction, and that it triggers a single ledger recompute. It stops short of stating partial-update semantics (whether omitted fields are cleared or left unchanged), which matters for a 16-param upsert.

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?

Three tight sentences, front-loaded with the core create/update purpose and the sibling disambiguation before the batching detail. The id-present/absent rule is stated twice (once standalone, once for items), a minor redundancy that keeps it just under a 5.

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 16-parameter, no-required, no-output-schema upsert, the definition covers purpose, sibling routing, create/update switch, batch atomicity, batch preference, and the create return value. The remaining gap is partial-update semantics and what happens to unmentioned fields, which an agent calling an upsert would want.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter is already documented, including the `id` present/absent semantics and the `items` batch behaviour. The description largely restates those schema descriptions rather than adding format, constraints, or defaulting rules beyond them, so the baseline 3 applies.

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 (create or update), a precise resource (an OPTION/variant under an existing product, with concrete examples like size, colour, pack), and explicitly routes the agent elsewhere for the parent product via 'for the product itself, use save_product'. An agent can distinguish this from save_product 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 selection conditions: pass `id` to update, omit `id` to create, and send an `items` array for bulk. It also names the alternative (save_product) and states the preference ('Preferred over repeated calls') for batching, leaving little to inference.

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