Skip to main content
Glama
tzangms

shopline-mcp

by tzangms

create_product_variation

Create a new product variation with SKU, price, and stock details to add options like color or size to an existing product.

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、價格、庫存、規格選項等)
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses key side effects: the variation is immediately added and available in the storefront, and duplicate SKUs may cause API errors. It also names the exact Shopline API endpoint and return structure, providing strong behavioral context.

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 well-structured with labeled sections (用途, 呼叫的 API, 回傳結構, 副作用) and front-loaded [WRITE] indicator. Every sentence adds useful information with no redundancy.

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 the tool has no output schema, the description compensates by detailing the return dict structure. It covers purpose, API endpoint, parameter shape, side effects, and an error condition, making it complete for an agent to invoke correctly.

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?

While the schema already describes all parameters (100% coverage), the description adds meaning by specifying that variation_data must follow Shopline Open API spec and includes SKU, price, inventory, and spec options. This goes beyond the generic schema description.

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 states a specific verb and resource: '為商品新增變體' (add variation to product). It clearly distinguishes from sibling tools like update_product_variation and delete_product_variation by focusing on creation of a new variation under an existing product.

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 explains usage in existing products for adding new spec variants (e.g., color, size), and implies this is for creation rather than update/delete. It does not explicitly name alternatives, but the context is clear enough for correct selection among sibling tools.

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/tzangms/shoplinemcp'

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