Skip to main content
Glama
tzangms

shopline-mcp

by tzangms

update_variation_quantity

Directly set the absolute inventory quantity for a product variation. Ideal for stock corrections after inventory counts or manual restocking.

Instructions

[WRITE] 更新商品變體庫存數量。

【用途】 直接設定特定變體的庫存數量。適用於盤點後調整庫存或手動補貨場景。 若要批次更新多個 SKU 庫存,可改用 bulk_update_quantities。

【呼叫的 Shopline API】

  • PUT /v1/products/{product_id}/variations/{variation_id}/quantity

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

【副作用】

  • 庫存數量立即更新,影響前台可購買數量

  • 若設為 0 且商品設定不允許超賣,前台將顯示缺貨

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
quantityYes新庫存數量(絕對值,非增減量)
product_idYes商品內部 ID
variation_idYes變體內部 ID
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses that the stock quantity updates immediately, affects front-end purchasable quantity, and if set to 0 with no oversell allowed, front-end will show out of stock. It also includes the API endpoint. While it doesn't mention auth requirements, it thoroughly explains side effects and operational 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?

Well-structured with clear sections (用途, 呼叫的 Shopline API, 回傳結構, 副作用). Information is concise and front-loaded, with the write indicator '[WRITE]' at the start. Every sentence adds value without 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?

For a simple 3-parameter update tool with no output schema, the description explains the purpose, the API endpoint, the return structure, and side effects. It is complete for the tool's complexity, and the sibling differentiation further enhances context.

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 coverage is 100%, so each parameter already has descriptions. The description adds clarity that quantity is an absolute value '新庫存數量(絕對值,非增減量)', which is already in the schema. According to the rubric, baseline is 3 when schema coverage is high, and the description doesn't significantly extend beyond the schema.

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 clearly states '直接設定特定變體的庫存數量' (directly set specific variation's stock quantity), which precisely describes the verb+resource+scope. It also distinguishes from sibling tools like bulk_update_quantities by noting it's for a single variance.

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?

Explicitly states when to use: '適用於盤點後調整庫存或手動補貨場景' (for inventory adjustment after stocktake or manual replenishment). It also gives an alternative: '若要批次更新多個 SKU 庫存,可改用 bulk_update_quantities' (for batch updates, use bulk_update_quantities), clearly naming the alternative.

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