@airwallex/developer-mcp
Version:
MCP server for AI agents that assist developers integrating with the Airwallex platform
37 lines (36 loc) • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.listGlobalAccountsToolConfig = exports.listGlobalAccountsSchema = void 0;
exports.executeListGlobalAccounts = executeListGlobalAccounts;
const zod_1 = require("zod");
const descriptions_1 = require("../constants/descriptions");
exports.listGlobalAccountsSchema = zod_1.z.object({});
async function executeListGlobalAccounts(airwallex) {
try {
const response = (await airwallex.get("/api/v1/global_accounts"));
return {
content: [
{
text: JSON.stringify(response, null, 2),
type: "text",
},
],
};
}
catch (error) {
// Simplified error handling
const statusCode = error?.status || error?.statusCode || 500;
const errorMessage = error?.message || "Unknown error occurred";
throw new Error(`Failed to list global accounts (${statusCode}): ${errorMessage}`);
}
}
exports.listGlobalAccountsToolConfig = {
annotations: {
openWorldHint: true,
readOnlyHint: true,
title: "List global accounts",
},
description: descriptions_1.TOOL_DESCRIPTIONS.LIST_GLOBAL_ACCOUNTS,
inputSchema: exports.listGlobalAccountsSchema,
name: "list_global_accounts",
};