Skip to main content
Glama

create_product_variation

Add a new product variation with SKU, price, and inventory. Each variation becomes selectable on the storefront immediately.

Instructions

[WRITE] 為商品新增變體。

【用途】 在現有商品下建立新的規格變體(如顏色、尺寸等)。variation_data 應依 Shopline Open API 規格組裝,含 SKU、價格、庫存等欄位。

【呼叫的 Shopline API】

  • POST /v1/products/{product_id}/variations

【回傳結構】 dict 含 success: bool, resource_id: str, message: str, variation: dict。

【副作用】

  • 變體立即加入商品,前台可供選擇

  • 若 SKU 重複,API 可能回傳錯誤

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idYes商品內部 ID
variation_dataYes變體資料(含 SKU、價格、庫存、規格選項等)
Behavior5/5

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

With no annotations, description carries full burden. It discloses side effects: variation is immediately added and available on frontend, and potential error on duplicate SKU. It also specifies the exact API endpoint (POST /v1/products/{product_id}/variations) and return structure (success, resource_id, message, variation).

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?

Description is well-structured with labeled sections (用途, API, 回傳結構, 副作用). The [WRITE] tag front-loads the operation type. Every sentence provides necessary information without repetition.

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?

Given no output schema, description provides complete return structure. It covers purpose, usage, API details, side effects, and parameter assembly guidance. For a creation tool with nested parameters, this is comprehensive.

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% with clear descriptions. Description adds value by stating variation_data should follow Shopline Open API spec, providing context beyond schema. However, it does not detail the nested structure of variation_data.

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?

Description explicitly states the tool creates a new product variation under an existing product, using specific verbs ('新增變體'). It specifies the resource (product) and the action (create variation), and distinguishes from sibling tools like update_product_variation and delete_product_variation.

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?

Description explains when to use: to add new specification variations (color, size) to an existing product. It provides context on how to assemble variation_data according to API specs. However, it does not explicitly state when not to use or compare with alternatives.

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/asgard-ai-platform/mcp-shopline'

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