Skip to main content
Glama
tzangms

shopline-mcp

by tzangms

claim_coupon

Claim a coupon for a customer, binding it to their account. Handles redemption codes and API-integrated member coupon claims.

Instructions

[WRITE] 客戶領取優惠券。

【用途】 代表客戶領取(claim)一張優惠券,將優惠券綁定至該客戶帳號。 適合兌換碼場景或 API 整合的會員領券流程。

【呼叫的 Shopline API】

  • POST /v1/coupons/claim

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

【副作用】

  • 優惠券與指定客戶綁定,消費者帳號中可看到此優惠券

  • 若優惠券已達領取上限或已過期,API 會回傳錯誤

  • 同一張優惠券通常每位客戶只能領取一次(依設定而異)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coupon_dataYes優惠券領取資料,通常包含 coupon_code 與客戶識別資訊
Behavior5/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 of behavioral disclosure. It explicitly labels the operation as [WRITE], lists side effects (coupon binding, visibility in customer account, error on limit/expiry, one-per-customer rule), and describes the return structure. This is exceptionally transparent and goes beyond what annotations would typically provide.

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 clear sections ([WRITE], 用途, API, 回傳結構, 副作用). Every section provides relevant information without any padding. The opening [WRITE] immediately signals the destructive/write nature, and the content is concise yet comprehensive.

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?

The description is complete for a tool of this complexity. It covers purpose, the underlying API endpoint, return structure, and side effects/error conditions. There is no output schema, but the description explicitly lists the return keys. Combined with the schema's coverage of coupon_data, it leaves no major gaps for an agent to correctly invoke the tool.

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?

The input schema already provides a description for coupon_data ('優惠券領取資料,通常包含 coupon_code 與客戶識別資訊') and the schema coverage is 100%, so the baseline is 3. The tool description adds only a brief hint about '兌換碼場景' that aligns with the schema, but it does not add new parameter details. Therefore, it does not exceed the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to claim a coupon on behalf of a customer and bind it to their account. It uses a specific verb ('claim') and resource ('coupon'), and even mentions suitable scenarios ('兌換碼場景'). However, it does not explicitly differentiate from sibling tools like send_coupon or redeem_coupon, so it loses the point for sibling differentiation.

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 provides clear context for when to use this tool: '適合兌換碼場景或 API 整合的會員領券流程' (suitable for redemption code scenarios or API-integrated member coupon claiming). It does not, however, mention when not to use it or explicitly point to alternatives among siblings, which would be needed for a 5.

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