UNPKG

@airwallex/developer-mcp

Version:

MCP server for AI agents that assist developers integrating with the Airwallex platform

39 lines (38 loc) 1.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.listBillingProductsToolConfig = exports.listBillingProductsSchema = void 0; exports.executeListBillingProducts = executeListBillingProducts; const zod_1 = require("zod"); const descriptions_1 = require("../constants/descriptions"); exports.listBillingProductsSchema = zod_1.z.object({}); async function executeListBillingProducts(airwallex) { try { const queryParams = new URLSearchParams(); queryParams.append("page_size", "100"); const url = `/api/v1/products${queryParams.toString() ? `?${queryParams.toString()}` : ""}`; const response = (await airwallex.get(url)); return { content: [ { text: JSON.stringify(response, null, 2), type: "text", }, ], }; } catch (error) { const statusCode = error?.status || error?.statusCode || 500; const errorMessage = error?.message || "Unknown error occurred"; throw new Error(`Failed to list billing products (${statusCode}): ${errorMessage}`); } } exports.listBillingProductsToolConfig = { annotations: { openWorldHint: true, readOnlyHint: true, title: "List billing products", }, description: descriptions_1.TOOL_DESCRIPTIONS.LIST_BILLING_PRODUCTS, inputSchema: exports.listBillingProductsSchema, name: "list_billing_products", };