// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import DodoPayments from 'dodopayments';
export const metadata: Metadata = {
resource: 'subscriptions',
operation: 'read',
tags: [],
httpMethod: 'get',
httpPath: '/subscriptions',
operationId: 'list_subscriptions_handler',
};
export const tool: Tool = {
name: 'list_subscriptions',
description: '',
inputSchema: {
type: 'object',
properties: {
brand_id: {
type: 'string',
description: 'filter by Brand id',
},
created_at_gte: {
type: 'string',
description: 'Get events after this created time',
format: 'date-time',
},
created_at_lte: {
type: 'string',
description: 'Get events created before this time',
format: 'date-time',
},
customer_id: {
type: 'string',
description: 'Filter by customer id',
},
page_number: {
type: 'integer',
description: 'Page number default is 0',
},
page_size: {
type: 'integer',
description: 'Page size default is 10 max is 100',
},
status: {
type: 'string',
description: 'Filter by status',
enum: ['pending', 'active', 'on_hold', 'cancelled', 'failed', 'expired'],
},
},
required: [],
},
annotations: {
readOnlyHint: true,
},
};
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
const body = args as any;
const response = await client.subscriptions.list(body).asResponse();
return asTextContentResult(await response.json());
};
export default { metadata, tool, handler };