// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { Metadata, asErrorResult, asTextContentResult } from '@whop/mcp/tools/types'; import { Tool } from '@modelcontextprotocol/sdk/types.js'; import Whop from '@whop/sdk'; export const metadata: Metadata = { resource: 'checkout_configurations', operation: 'read', tags: [], httpMethod: 'get', httpPath: '/checkout_configurations', operationId: 'listCheckoutConfiguration', }; export const tool: Tool = { name: 'list_checkout_configurations', description: 'Lists checkout configurations\n\nRequired permissions:\n - `checkout_configuration:basic:read`', inputSchema: { type: 'object', properties: { company_id: { type: 'string', description: 'The ID of the company to list checkout configurations for', }, after: { type: 'string', description: 'Returns the elements in the list that come after the specified cursor.', }, before: { type: 'string', description: 'Returns the elements in the list that come before the specified cursor.', }, created_after: { type: 'string', description: 'The minimum creation date to filter by', format: 'date-time', }, created_before: { type: 'string', description: 'The maximum creation date to filter by', format: 'date-time', }, direction: { $ref: '#/$defs/direction', }, first: { type: 'integer', description: 'Returns the first _n_ elements from the list.', }, last: { type: 'integer', description: 'Returns the last _n_ elements from the list.', }, plan_id: { type: 'string', description: 'The ID of the plan to filter checkout configurations by', }, }, required: ['company_id'], $defs: { direction: { type: 'string', description: 'The direction of the sort.', enum: ['asc', 'desc'], }, }, }, annotations: { readOnlyHint: true, }, }; export const handler = async (client: Whop, args: Record | undefined) => { const body = args as any; const response = await client.checkoutConfigurations.list(body).asResponse(); try { return asTextContentResult(await response.json()); } catch (error) { if (error instanceof Whop.APIError) { return asErrorResult(error.message); } throw error; } }; export default { metadata, tool, handler };