List customer subscriptions
deonpay_list_customer_subscriptionsList individual customer subscriptions filtered by plan, email, or status. Returns charges, billing periods, and next charge date.
Instructions
List individual customer subscriptions (the per-customer rows, NOT the plans). Use this to answer 'who is currently subscribed to plan X', 'how many trialing subscribers do I have', or 'find subscribers on past_due'. Filter by subscription_id (the plan), customer_email (exact, case-insensitive), and status (active/paused/cancelled/past_due/completed/trialing). Each item includes the plan denormalized as a subscription sub-object, charges_count, total_charged in centavos, current_period_start/end, next_charge_at, and cancel_at_period_end.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-based). Defaults to 1. | |
| limit | No | Page size. Maximum 100, default 20. | |
| subscription_id | No | Filter by plan UUID. | |
| customer_email | No | Exact email match (case-insensitive). | |
| status | No | ||
| environment | No | Override the environment to query. The DeonPay API only honors this if it matches the environment baked into the API token; otherwise it is silently ignored. Useful when the same dashboard exposes both envs. |
Implementation Reference
- The handler function that executes the tool logic. It calls client.get('/customer-subscriptions', compact(args)) to fetch the list of customer subscriptions from the DeonPay API.
safeHandler(async (args) => { return client.get( "/customer-subscriptions", compact(args), ); }), - Input schema for the tool, defining optional parameters: page, limit, subscription_id (UUID), customer_email (exact match), status (active/paused/cancelled/past_due/completed/trialing), and environment.
{ title: "List customer subscriptions", description: "List individual customer subscriptions (the per-customer rows, NOT the plans). Use this to answer 'who is currently subscribed to plan X', 'how many trialing subscribers do I have', or 'find subscribers on past_due'. Filter by subscription_id (the plan), customer_email (exact, case-insensitive), and status (active/paused/cancelled/past_due/completed/trialing). Each item includes the plan denormalized as a `subscription` sub-object, charges_count, total_charged in centavos, current_period_start/end, next_charge_at, and cancel_at_period_end.", inputSchema: { page: PageSchema.optional(), limit: LimitSchema.optional(), subscription_id: z.string().uuid().optional().describe("Filter by plan UUID."), customer_email: z.string().email().optional().describe("Exact email match (case-insensitive)."), status: CustomerSubscriptionStatusSchema.optional(), environment: EnvironmentSchema.optional(), }, }, - Zod enum schema validating subscription status values: active, paused, cancelled, past_due, completed, trialing.
const CustomerSubscriptionStatusSchema = z.enum([ "active", "paused", "cancelled", "past_due", "completed", "trialing", ]); - src/tools/customer-subscriptions.ts:25-53 (registration)The registerCustomerSubscriptionTools function that registers the tool on the McpServer with the name 'deonpay_list_customer_subscriptions'.
export function registerCustomerSubscriptionTools( server: McpServer, client: DeonpayClient, ): void { // ------------------------------------------------------------------------- // deonpay_list_customer_subscriptions // ------------------------------------------------------------------------- server.registerTool( "deonpay_list_customer_subscriptions", { title: "List customer subscriptions", description: "List individual customer subscriptions (the per-customer rows, NOT the plans). Use this to answer 'who is currently subscribed to plan X', 'how many trialing subscribers do I have', or 'find subscribers on past_due'. Filter by subscription_id (the plan), customer_email (exact, case-insensitive), and status (active/paused/cancelled/past_due/completed/trialing). Each item includes the plan denormalized as a `subscription` sub-object, charges_count, total_charged in centavos, current_period_start/end, next_charge_at, and cancel_at_period_end.", inputSchema: { page: PageSchema.optional(), limit: LimitSchema.optional(), subscription_id: z.string().uuid().optional().describe("Filter by plan UUID."), customer_email: z.string().email().optional().describe("Exact email match (case-insensitive)."), status: CustomerSubscriptionStatusSchema.optional(), environment: EnvironmentSchema.optional(), }, }, safeHandler(async (args) => { return client.get( "/customer-subscriptions", compact(args), ); }), ); - src/tools/index.ts:20-29 (registration)Top-level registration: registerAllTools calls registerCustomerSubscriptionTools to wire up all customer subscription tools on the MCP server.
export function registerAllTools(server: McpServer, client: DeonpayClient): void { registerLinkTools(server, client); registerCheckoutTools(server, client); registerTransactionTools(server, client); registerProductTools(server, client); registerSubscriptionTools(server, client); registerCustomerSubscriptionTools(server, client); registerCustomerTools(server, client); registerMetricsTools(server, client); }