Skip to main content
Glama

update_product_quantity

Update inventory quantity for non-variant products by setting an absolute new quantity. Use for stock adjustments or manual restocking after inventory checks.

Instructions

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

【用途】 直接設定無變體商品的庫存數量。適用於盤點後調整庫存或手動補貨場景。 若商品有變體,請改用 update_variation_quantity。

【呼叫的 Shopline API】

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

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

【副作用】

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

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

Input Schema

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

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

No annotations provided, but description discloses side effects: immediate update, affects frontend availability, setting to 0 with no overselling shows out of stock. Also mentions API endpoint. Could mention permissions or rate limits.

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?

Structured with sections and bullet points. Concise but covers purpose, usage, API, return, side effects. Slightly verbose but efficient.

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?

No output schema, but description explains return structure and side effects. Missing error conditions, but adequate for a simple update tool.

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 100%, description adds value by clarifying that quantity is absolute (非增減量), which is not in 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?

Clearly states it updates stock quantity for non-variant products, with specific verb '更新庫存數量' and resource '無變體商品'. Distinguishes from sibling tool update_variation_quantity.

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 says when to use (庫存調整, 手動補貨) and when not (if product has variants, use update_variation_quantity). Provides clear context.

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