Smartrr MCP by usefulapi
Manage Smartrr subscriptions on Shopify: customers, orders, bills; pause, resume, cancel.
我該用這個嗎
品質與安全性
發現項目(8)
- HIGH
- MEDIUM在 smartrr_get_subscription_bills 中
- LOW在 smartrr_list_customer_subscriptions 中
- LOW在 smartrr_get_subscription_events 中
- LOW在 smartrr_get_subscription_orders 中
- LOW在 smartrr_list_selling_plan_groups 中
- LOW在 smartrr_list_cancellation_reasons 中
- LOW在 smartrr_cancel_customer_subscription 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"smartrr": {
"url": "https://smartrr.usefulapi.io/mcp"
}
}
}遠端端點
https://smartrr.usefulapi.io/mcpstreamable-http它能做什麼
工具清單
工具(21)
🟢smartrr_list_subscriptions(status, next_billing_after, next_billing_before, created_after, created_before, ...)
List customer subscriptions (Smartrr 'purchase states') with status, next billing date, selling plan, line items, shipping address, discounts and the customer (id, email, name). Filter by status, next billing date or creation date. The ids you need for the other tools: `id` (subscription id), `custRel.id` (customer id) and `shopifyId` (Shopify subscription id). GET /vendor/purchase-state.
輸入結構描述
{
"type": "object",
"properties": {
"status": {
"description": "Only subscriptions in this status.",
"type": "string",
"enum": [
"ACTIVE",
"PAUSED",
"CANCELLED",
"EXPIRED",
"FAILED"
]
},
"next_billing_after": {
"description": "Only subscriptions whose next billing date is on or after this date.",
"type": "string"
},
"next_billing_before": {
"description": "Only subscriptions whose next billing date is on or before this date.",
"type": "string"
},
"created_after": {
"description": "Only subscriptions created on or after this date.",
"type": "string"
},
"created_before": {
"description": "Only subscriptions created on or before this date.",
"type": "string"
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_subscription(shopify_subscription_id)
One subscription by its Shopify subscription id (the `shopifyId` field from smartrr_list_subscriptions, passed exactly as shown): status, schedule, next billing date, line items, discounts, shipping address, customer and payment method (brand, last digits and expiry only). GET /vendor/purchase-state/{shopifySubscriptionId}.
輸入結構描述
{
"type": "object",
"properties": {
"shopify_subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The subscription's Shopify id (`shopifyId` in smartrr_list_subscriptions)."
}
},
"required": [
"shopify_subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_customer_subscriptions(customer_id, status, page, page_size)
List the subscriptions of one customer, by Smartrr customer id (`custRel.id` from smartrr_list_subscriptions, or `id` from smartrr_list_customers). GET /vendor/customer/{customerRelationshipId}/purchase-state/.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id."
},
"status": {
"description": "Only subscriptions in this status.",
"type": "string",
"enum": [
"ACTIVE",
"PAUSED",
"CANCELLED",
"EXPIRED",
"FAILED"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"required": [
"customer_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_subscription_events(shopify_subscription_id)
The 250 most recent events on a subscription (pause, skip, cancel, activate, billing attempts and failures, line-item and address changes, discounts) with who did it. GET /vendor/purchase-state/{shopifySubscriptionId}/events.
輸入結構描述
{
"type": "object",
"properties": {
"shopify_subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The subscription's Shopify id (`shopifyId` in smartrr_list_subscriptions)."
}
},
"required": [
"shopify_subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_subscription_orders(shopify_subscription_id, sort, page, page_size)
Orders generated by one subscription, by its Shopify subscription id. GET /vendor/purchase-state/{shopifySubscriptionId}/orders.
輸入結構描述
{
"type": "object",
"properties": {
"shopify_subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The subscription's Shopify id (`shopifyId` in smartrr_list_subscriptions)."
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"required": [
"shopify_subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_subscription_bills(shopify_subscription_id, sort, page, page_size)
Billing attempts of one subscription (amount, status pending/processing/succeeded/failed/canceled, billing date, retry count, error), by its Shopify subscription id. GET /vendor/purchase-state/{shopifySubscriptionId}/bills.
輸入結構描述
{
"type": "object",
"properties": {
"shopify_subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The subscription's Shopify id (`shopifyId` in smartrr_list_subscriptions)."
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"required": [
"shopify_subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_customers(email, shopify_customer_id, sort, page, page_size)
List Smartrr customers (subscribers) with email, name, phone, order count, total spent and custom attributes. Search by email fragment or filter by Shopify customer id. GET /vendor/customer-relationship.
輸入結構描述
{
"type": "object",
"properties": {
"email": {
"description": "Customers whose email contains this text.",
"type": "string",
"minLength": 1,
"maxLength": 200
},
"shopify_customer_id": {
"description": "Only the customer with this Shopify customer id.",
"type": "string",
"minLength": 1,
"maxLength": 100
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_orders(processed_after, processed_before, order_label, sort, page, ...)
List orders Smartrr has synced from Shopify (subscription and one-time) with totals, status, financial and fulfillment status, tracking, items and customer. Filter by processed date or order label (e.g. #1001). GET /vendor/order.
輸入結構描述
{
"type": "object",
"properties": {
"processed_after": {
"description": "Only orders processed on or after this date.",
"type": "string"
},
"processed_before": {
"description": "Only orders processed on or before this date.",
"type": "string"
},
"order_label": {
"description": "Orders whose Shopify order label contains this text, e.g. #1001.",
"type": "string",
"minLength": 1,
"maxLength": 100
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_order(shopify_order_id)
One order by its Shopify order id (the `shopifyId` field in smartrr_list_orders, passed as shown). GET /vendor/orders/{shopifyId}.
輸入結構描述
{
"type": "object",
"properties": {
"shopify_order_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The order's Shopify id (`shopifyId` in smartrr_list_orders)."
}
},
"required": [
"shopify_order_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_bills(status, billing_after, billing_before, sort, page, ...)
List billing attempts across all subscriptions with amount, status (pending, processing, succeeded, failed, canceled), billing date, retry count, error and the subscription and customer. Filter by billing date; `status` filters the returned page only (use page_size 100 and next_page to cover more). Bill ids are numbers. GET /vendor/bill.
輸入結構描述
{
"type": "object",
"properties": {
"status": {
"description": "Keep only bills in this status (applied to the fetched page, not server-side).",
"type": "string",
"enum": [
"pending",
"processing",
"succeeded",
"failed",
"canceled"
]
},
"billing_after": {
"description": "Only bills with a billing date on or after this date.",
"type": "string"
},
"billing_before": {
"description": "Only bills with a billing date on or before this date.",
"type": "string"
},
"sort": {
"description": "Sort by creation date (default: Smartrr's own order).",
"type": "string",
"enum": [
"newest",
"oldest"
]
},
"page": {
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100000
},
"page_size": {
"description": "Results per page, 1-100 (default 25).",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_bill_history(bill_id)
The audit trail of one bill: every status change, retry and error. GET /vendor/bill/{billId}/history.
輸入結構描述
{
"type": "object",
"properties": {
"bill_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smartrr bill id (numeric `id` in smartrr_list_bills)."
}
},
"required": [
"bill_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_selling_plan_groups
The store's subscription programs (selling plan groups) and their plans: name, options, delivery and billing frequency, discounts. GET /vendor/selling-plan-group.
輸入結構描述
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_list_cancellation_reasons
The cancellation reasons configured in Smartrr (id, type, text, action, retention discount). Use an `id` as reason_id when cancelling a subscription. GET /vendor/cancellation-reasons.
輸入結構描述
{
"type": "object",
"properties": {},
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟢smartrr_get_analytics(start_date, end_date)
Active subscription count and active subscriber count for each day in a date range. GET /vendor/analytics-simple.
輸入結構描述
{
"type": "object",
"properties": {
"start_date": {
"type": "string",
"description": "First day of the range."
},
"end_date": {
"type": "string",
"description": "Last day of the range."
}
},
"required": [
"start_date",
"end_date"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟡smartrr_pause_subscription(customer_id, subscription_id, unpause_date)
WRITE: pause a customer's subscription until a date: no orders or charges are created while it is paused, then it resumes on that date. Reverse it with smartrr_resume_subscription. Takes the customer id and subscription id from smartrr_list_subscriptions. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/pause.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"unpause_date": {
"type": "string",
"description": "When the subscription resumes."
}
},
"required": [
"customer_id",
"subscription_id",
"unpause_date"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟡smartrr_resume_subscription(customer_id, subscription_id, next_billing_date)
WRITE: reactivate a paused or cancelled subscription; the customer will be billed on next_billing_date and every cycle after. Customer-facing: it restarts charges to the customer's card. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/activate.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"next_billing_date": {
"type": "string",
"description": "The next billing date after reactivation."
}
},
"required": [
"customer_id",
"subscription_id",
"next_billing_date"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴smartrr_cancel_customer_subscription(customer_id, subscription_id, reason_id)
WRITE, DESTRUCTIVE: cancel a customer's subscription in the merchant's store (this is the customer's Smartrr subscription, not your usefulapi plan). It stops all future orders and charges; the reason may trigger Smartrr's configured cancellation emails or actions. It can be undone only with smartrr_resume_subscription. Get reason_id from smartrr_list_cancellation_reasons. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/cancel.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"reason_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Cancellation reason id from smartrr_list_cancellation_reasons."
}
},
"required": [
"customer_id",
"subscription_id",
"reason_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟡smartrr_skip_order(customer_id, subscription_id, date)
WRITE: skip one scheduled order of a subscription (no order and no charge for that cycle; the schedule moves on). `date` is the scheduled order date to skip; omit it to skip the next one. Reverse with smartrr_unskip_order. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/skip.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"date": {
"description": "The scheduled order date to skip (default: the next order).",
"type": "string"
}
},
"required": [
"customer_id",
"subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟡smartrr_unskip_order(customer_id, subscription_id, date)
WRITE: restore a previously skipped order of a subscription, so it is billed and shipped again. `date` is the skipped order date; omit it to restore the earliest skip. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/unskip.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"date": {
"description": "The skipped order date to restore (default: the earliest skipped one).",
"type": "string"
}
},
"required": [
"customer_id",
"subscription_id"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🟡smartrr_set_next_billing_date(customer_id, subscription_id, date)
WRITE: change the date on which a subscription is next billed and its order created. Customer-facing: the customer is charged on the new date. PUT /vendor/customer/{customerId}/purchase-state/{subscriptionId}/next-billing-date.
輸入結構描述
{
"type": "object",
"properties": {
"customer_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr customer id (`custRel.id`)."
},
"subscription_id": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "Smartrr subscription id (`id`, a UUID)."
},
"date": {
"type": "string",
"description": "The new next billing date."
}
},
"required": [
"customer_id",
"subscription_id",
"date"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}🔴smartrr_retry_bill(bill_id, confirm)
WRITE, CHARGES THE CUSTOMER: retry a billing attempt now. If it succeeds the customer's saved payment method is charged for the bill amount and the order is created. Check the bill with smartrr_list_bills first; do not retry a succeeded bill. Not idempotent: each call can charge again. Requires confirm=true. POST /vendor/bill/{billId}/retry.
輸入結構描述
{
"type": "object",
"properties": {
"bill_id": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991,
"description": "Smartrr bill id (numeric `id` in smartrr_list_bills)."
},
"confirm": {
"type": "boolean",
"const": true,
"description": "Must be true: confirms the customer's saved payment method should be charged now."
}
},
"required": [
"bill_id",
"confirm"
],
"$schema": "https://json-schema.org/draft/2020-12/schema"
}社群
證據