smile-io
Look up loyalty customers, points history, rewards and VIP tiers, and add points or activities.
我該用這個嗎
品質與安全性
發現項目(1)
- LOW在 smile_create_points_transaction 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"smile-io": {
"url": "https://smile-io.usefulapi.io/mcp"
}
}
}遠端端點
https://smile-io.usefulapi.io/mcpstreamable-http它能做什麼
工具清單
工具(14)
🟢smile_list_customers(email, state, updated_at_min, include_vip_status, limit, ...)
List loyalty-program customers, newest first, with their points balance, state and VIP tier id. Look a customer up by exact email, or filter by state or last-updated time. Cursor-paginated (metadata.next_cursor). Smile: GET /customers.
輸入結構描述
{
"type": "object",
"properties": {
"email": {
"description": "Exact email address to look up.",
"type": "string"
},
"state": {
"description": "candidate = not yet joined, member = in the program, disabled = excluded.",
"type": "string",
"enum": [
"candidate",
"member",
"disabled"
]
},
"updated_at_min": {
"description": "Only records updated at/after this ISO 8601 date-time, e.g. 2026-01-01T00:00:00Z.",
"type": "string"
},
"include_vip_status": {
"description": "Include each customer's vip_status object (include=vip_status).",
"type": "boolean"
},
"limit": {
"description": "Maximum number of results, 1-250 (Smile default 50).",
"type": "integer",
"minimum": 1,
"maximum": 250
},
"cursor": {
"description": "Cursor from the previous response's metadata.next_cursor (or previous_cursor). Omit for the first page.",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_get_customer(customer_id, include)
Fetch one customer by Smile customer ID: name, email, state, points_balance, referral_url, vip_tier_id, and optionally their VIP status with current and next tier. Smile: GET /customers/{id}.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile customer ID."
},
"include": {
"description": "Related objects to include, e.g. [\"vip_status.vip_tier\", \"vip_status.next_vip_tier\"].",
"type": "array",
"items": {
"type": "string",
"enum": [
"vip_status",
"vip_status.vip_tier",
"vip_status.next_vip_tier"
]
}
}
},
"required": [
"customer_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_list_points_transactions(customer_id, updated_at_min, limit, cursor)
List points transactions (every earn, spend and manual adjustment), newest first — e.g. a customer's full points history. Each has points_change (+/-), a customer-visible description and a merchant internal_note. Cursor-paginated. Smile: GET /points_transactions.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"description": "Only this customer's transactions.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"updated_at_min": {
"description": "Only records updated at/after this ISO 8601 date-time, e.g. 2026-01-01T00:00:00Z.",
"type": "string"
},
"limit": {
"description": "Maximum number of results, 1-250 (Smile default 50).",
"type": "integer",
"minimum": 1,
"maximum": 250
},
"cursor": {
"description": "Cursor from the previous response's metadata.next_cursor (or previous_cursor). Omit for the first page.",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_get_points_transaction(points_transaction_id)
Fetch one points transaction by ID. Smile: GET /points_transactions/{id}.
輸入結構描述
{
"type": "object",
"properties": {
"points_transaction_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile points transaction ID."
}
},
"required": [
"points_transaction_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_list_points_products(exchange_type, page, page_size)
List points products — the rewards customers can buy with points. 'fixed' products cost points_price; 'variable' products trade variable_points_step points for variable_points_step_reward_value, between variable_points_min and variable_points_max. Each embeds its reward. Page-numbered (page, page_size); a page shorter than page_size is the last. Smile: GET /points_products.
輸入結構描述
{
"type": "object",
"properties": {
"exchange_type": {
"description": "Only fixed- or variable-price products.",
"type": "string",
"enum": [
"fixed",
"variable"
]
},
"page": {
"description": "Page number, starting at 1.",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"page_size": {
"description": "Results per page, 1-250 (default 50).",
"type": "integer",
"minimum": 1,
"maximum": 250
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_get_points_product(points_product_id)
Fetch one points product (a way to redeem points) by ID, including its reward. Smile: GET /points_products/{id}.
輸入結構描述
{
"type": "object",
"properties": {
"points_product_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile points product ID."
}
},
"required": [
"points_product_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_list_reward_fulfillments(customer_id, fulfillment_status, usage_status, updated_at_min, limit, ...)
List rewards that have been issued to customers — usually discount codes — with code, fulfillment_status (pending/issued/cancelled/failed), usage_status (used/unused/untracked), used_at and expires_at. Use customer_id to answer 'what codes does this customer have?'. Cursor-paginated. Smile: GET /reward_fulfillments.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"description": "Only this customer's rewards.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"fulfillment_status": {
"type": "string",
"enum": [
"pending",
"issued",
"cancelled",
"failed"
]
},
"usage_status": {
"type": "string",
"enum": [
"used",
"unused",
"untracked"
]
},
"updated_at_min": {
"description": "Only records updated at/after this ISO 8601 date-time, e.g. 2026-01-01T00:00:00Z.",
"type": "string"
},
"limit": {
"description": "Maximum number of results, 1-250 (Smile default 50).",
"type": "integer",
"minimum": 1,
"maximum": 250
},
"cursor": {
"description": "Cursor from the previous response's metadata.next_cursor (or previous_cursor). Omit for the first page.",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_list_earning_rules(limit, cursor)
List the enabled earning rules — the ways customers earn points or rewards (placing an order, signing up, birthdays, custom activities), with reward, reward_value, earning_limit and any VIP-tier restriction. Cursor-paginated. Smile: GET /earning_rules.
輸入結構描述
{
"type": "object",
"properties": {
"limit": {
"description": "Maximum number of results, 1-250 (Smile default 50).",
"type": "integer",
"minimum": 1,
"maximum": 250
},
"cursor": {
"description": "Cursor from the previous response's metadata.next_cursor (or previous_cursor). Omit for the first page.",
"type": "string"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_list_vip_tiers(include)
List the VIP program's tiers, sorted by milestone (the threshold to reach each tier), optionally with each tier's perks and entry rewards. Smile: GET /vip_tiers.
輸入結構描述
{
"type": "object",
"properties": {
"include": {
"description": "Nested objects to include, e.g. [\"perks\", \"entry_rewards\"].",
"type": "array",
"items": {
"type": "string",
"enum": [
"perks",
"entry_rewards"
]
}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_get_points_settings
Fetch the points program's configuration, e.g. the points currency label ("Points", "Stars"). Smile: GET /points_settings.
輸入結構描述
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smile_get_referral_settings
Fetch the referral program's configuration: whether it is active, and the sender (advocate) and receiver (friend) rewards. Smile: GET /referral_settings.
輸入結構描述
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴smile_create_points_transaction(customer_id, points_change, description, internal_note)
WRITE: add or deduct points from a customer's balance (a manual adjustment, e.g. a goodwill credit or a correction). points_change > 0 adds, < 0 deducts; Smile rejects a deduction that would make the balance negative. Undo by creating an opposite adjustment. `description` is shown to the customer; `internal_note` is merchant-only. To reward a customer for completing an action, prefer smile_create_activity. Requires the points_transaction:write scope. Smile: POST /points_transactions.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile customer ID."
},
"points_change": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Points to add (positive) or deduct (negative)."
},
"description": {
"description": "Customer-visible reason, e.g. \"Points correction\".",
"type": "string",
"maxLength": 500
},
"internal_note": {
"description": "Merchant-only note, never shown to the customer.",
"type": "string",
"maxLength": 1000
}
},
"required": [
"customer_id",
"points_change"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴smile_create_activity(token, customer_id, customer_email, distinct_id, created_on_origin_at)
WRITE: record that a customer performed an action (identified by an activity type token configured in Smile Admin, e.g. a custom 'newsletter signup' activity). Smile then asynchronously applies the store's earning rules and may issue points or rewards. Identify the customer by customer_id OR customer_email (exactly one). Pass distinct_id (e.g. an order number) to make it idempotent — a second activity with the same token + distinct_id is rejected. Custom activity types need Smile's Plus/Enterprise plan. Requires the activity:write scope. Smile: POST /activities.
輸入結構描述
{
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 1,
"description": "Activity type token, e.g. activity_f57a9b5a8d0ac5."
},
"customer_id": {
"description": "Smile customer ID (or give customer_email).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"customer_email": {
"description": "Customer email (or give customer_id).",
"type": "string",
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"distinct_id": {
"description": "Unique id for this activity in your system; prevents duplicates for the same token.",
"type": "string"
},
"created_on_origin_at": {
"description": "ISO 8601 date-time the action actually happened, if earlier than now.",
"type": "string"
}
},
"required": [
"token"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴smile_purchase_points_product(points_product_id, customer_id, points_to_spend)
WRITE — SPENDS THE CUSTOMER'S POINTS: redeem points on the customer's behalf by purchasing a points product; Smile deducts the points and issues the reward (the response's points_purchase.reward_fulfillment usually holds a discount code). Only do this when the customer asked for it. For a 'variable' product pass points_to_spend; leave it out for 'fixed' products. There is no API to cancel a redemption — a mistaken one can only be compensated with smile_create_points_transaction. Requires the points_purchase:write scope. Smile: POST /points_products/{id}/purchase.
輸入結構描述
{
"type": "object",
"properties": {
"points_product_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile points product ID."
},
"customer_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smile customer ID."
},
"points_to_spend": {
"description": "Points to spend — variable-price products only.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"points_product_id",
"customer_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}社群
證據