Skip to main content
Glama

redeem_coupon

Redeem a coupon in a checkout or POS scenario. Marks the coupon as used to prevent reuse and records the redemption for reporting.

Instructions

[WRITE] 核銷(使用)優惠券。

【用途】 在結帳或特定場景下核銷優惠券,將優惠券標記為已使用狀態。 適合 POS 場景或 API 整合的結帳流程。

【呼叫的 Shopline API】

  • POST /v1/coupons/redeem

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

【副作用】

  • 優惠券狀態變更為已使用,不可再次使用(一次性優惠券)

  • 核銷紀錄會寫入系統,影響促銷統計報告

  • 操作通常不可逆,請確認核銷對象與條件正確

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 provided, but the description clearly lists side effects: coupon marked as used (irreversible), records written affecting reports. This provides essential behavioral transparency for an irreversible write operation.

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?

The description is well-structured with sections like [WRITE], 【用途】, 【呼叫的 Shopline API】, 【回傳結構】, 【副作用】. It is informative but slightly verbose, though all content is relevant.

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, the description includes return structure (dict with success, resource_id, etc.) and covers purpose, API endpoint, side effects, and usage scenario. It is comprehensive for a simple coupon redemption 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?

The single parameter 'coupon_data' has a description that adds meaning: '通常包含 coupon_code 與訂單或客戶識別資訊' (typically includes coupon code and order/customer ID). While the schema coverage is 100%, the description provides useful context beyond the type definition.

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 starts with '[WRITE] 核銷(使用)優惠券', clearly indicating it's a write operation to redeem a coupon. It specifies the verb and resource, and distinguishes from sibling 'claim_coupon' which is a different action.

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 states when to use: '在結帳或特定場景下核銷優惠券' (during checkout or specific scenarios). It does not explicitly mention when not to use or alternatives, but the context is clear enough.

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