UNPKG

@airwallex/developer-mcp

Version:

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

39 lines (38 loc) 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.listPaymentLinksToolConfig = exports.listPaymentLinksSchema = void 0; exports.executeListPaymentLinks = executeListPaymentLinks; const zod_1 = require("zod"); const descriptions_1 = require("../constants/descriptions"); exports.listPaymentLinksSchema = zod_1.z.object({}); async function executeListPaymentLinks(airwallex) { try { const queryParams = new URLSearchParams(); queryParams.append("page_size", "100"); const url = `/api/v1/pa/payment_links${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 payment links (${statusCode}): ${errorMessage}`); } } exports.listPaymentLinksToolConfig = { annotations: { openWorldHint: true, readOnlyHint: true, title: "List payment links", }, description: descriptions_1.TOOL_DESCRIPTIONS.LIST_PAYMENT_LINKS, inputSchema: exports.listPaymentLinksSchema, name: "list_payment_links", };