@monnify/mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +563 -0
- package/build/auth/tokenManager.d.ts +11 -0
- package/build/auth/tokenManager.d.ts.map +1 -0
- package/build/auth/tokenManager.js +62 -0
- package/build/auth/tokenManager.js.map +1 -0
- package/build/cli.d.ts +3 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +39 -0
- package/build/cli.js.map +1 -0
- package/build/client/monnifyClient.d.ts +7 -0
- package/build/client/monnifyClient.d.ts.map +1 -0
- package/build/client/monnifyClient.js +119 -0
- package/build/client/monnifyClient.js.map +1 -0
- package/build/config/env.d.ts +47 -0
- package/build/config/env.d.ts.map +1 -0
- package/build/config/env.js +39 -0
- package/build/config/env.js.map +1 -0
- package/build/index.d.ts +36 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +84 -0
- package/build/index.js.map +1 -0
- package/build/schemas/compat.d.ts +24 -0
- package/build/schemas/compat.d.ts.map +1 -0
- package/build/schemas/compat.js +20 -0
- package/build/schemas/compat.js.map +1 -0
- package/build/schemas/extended/collections.d.ts +439 -0
- package/build/schemas/extended/collections.d.ts.map +1 -0
- package/build/schemas/extended/collections.js +403 -0
- package/build/schemas/extended/collections.js.map +1 -0
- package/build/schemas/extended/directDebit.d.ts +123 -0
- package/build/schemas/extended/directDebit.d.ts.map +1 -0
- package/build/schemas/extended/directDebit.js +121 -0
- package/build/schemas/extended/directDebit.js.map +1 -0
- package/build/schemas/extended/verification.d.ts +55 -0
- package/build/schemas/extended/verification.d.ts.map +1 -0
- package/build/schemas/extended/verification.js +51 -0
- package/build/schemas/extended/verification.js.map +1 -0
- package/build/schemas/generated.d.ts +4 -0
- package/build/schemas/generated.d.ts.map +1 -0
- package/build/schemas/generated.js +2603 -0
- package/build/schemas/generated.js.map +1 -0
- package/build/security/guards.d.ts +5 -0
- package/build/security/guards.d.ts.map +1 -0
- package/build/security/guards.js +43 -0
- package/build/security/guards.js.map +1 -0
- package/build/security/sanitiser.d.ts +46 -0
- package/build/security/sanitiser.d.ts.map +1 -0
- package/build/security/sanitiser.js +269 -0
- package/build/security/sanitiser.js.map +1 -0
- package/build/tools/collections/authoriseCard3ds.d.ts +7 -0
- package/build/tools/collections/authoriseCard3ds.d.ts.map +1 -0
- package/build/tools/collections/authoriseCard3ds.js +63 -0
- package/build/tools/collections/authoriseCard3ds.js.map +1 -0
- package/build/tools/collections/authoriseCardOtp.d.ts +7 -0
- package/build/tools/collections/authoriseCardOtp.d.ts.map +1 -0
- package/build/tools/collections/authoriseCardOtp.js +55 -0
- package/build/tools/collections/authoriseCardOtp.js.map +1 -0
- package/build/tools/collections/chargeCard.d.ts +7 -0
- package/build/tools/collections/chargeCard.d.ts.map +1 -0
- package/build/tools/collections/chargeCard.js +59 -0
- package/build/tools/collections/chargeCard.js.map +1 -0
- package/build/tools/collections/chargeCardToken.d.ts +7 -0
- package/build/tools/collections/chargeCardToken.d.ts.map +1 -0
- package/build/tools/collections/chargeCardToken.js +68 -0
- package/build/tools/collections/chargeCardToken.js.map +1 -0
- package/build/tools/collections/createInvoice.d.ts +7 -0
- package/build/tools/collections/createInvoice.d.ts.map +1 -0
- package/build/tools/collections/createInvoice.js +57 -0
- package/build/tools/collections/createInvoice.js.map +1 -0
- package/build/tools/collections/deallocateReservedAccount.d.ts +14 -0
- package/build/tools/collections/deallocateReservedAccount.d.ts.map +1 -0
- package/build/tools/collections/deallocateReservedAccount.js +55 -0
- package/build/tools/collections/deallocateReservedAccount.js.map +1 -0
- package/build/tools/collections/getAllTransactions.d.ts +47 -0
- package/build/tools/collections/getAllTransactions.d.ts.map +1 -0
- package/build/tools/collections/getAllTransactions.js +140 -0
- package/build/tools/collections/getAllTransactions.js.map +1 -0
- package/build/tools/collections/getReservedAccount.d.ts +14 -0
- package/build/tools/collections/getReservedAccount.d.ts.map +1 -0
- package/build/tools/collections/getReservedAccount.js +55 -0
- package/build/tools/collections/getReservedAccount.js.map +1 -0
- package/build/tools/collections/getReservedAccountTransactions.d.ts +20 -0
- package/build/tools/collections/getReservedAccountTransactions.d.ts.map +1 -0
- package/build/tools/collections/getReservedAccountTransactions.js +86 -0
- package/build/tools/collections/getReservedAccountTransactions.js.map +1 -0
- package/build/tools/collections/getTransactionDetails.d.ts +14 -0
- package/build/tools/collections/getTransactionDetails.d.ts.map +1 -0
- package/build/tools/collections/getTransactionDetails.js +60 -0
- package/build/tools/collections/getTransactionDetails.js.map +1 -0
- package/build/tools/collections/getTransactionStatus.d.ts +7 -0
- package/build/tools/collections/getTransactionStatus.d.ts.map +1 -0
- package/build/tools/collections/getTransactionStatus.js +58 -0
- package/build/tools/collections/getTransactionStatus.js.map +1 -0
- package/build/tools/collections/initiatePayment.d.ts +7 -0
- package/build/tools/collections/initiatePayment.d.ts.map +1 -0
- package/build/tools/collections/initiatePayment.js +63 -0
- package/build/tools/collections/initiatePayment.js.map +1 -0
- package/build/tools/collections/payWithBankTransfer.d.ts +7 -0
- package/build/tools/collections/payWithBankTransfer.d.ts.map +1 -0
- package/build/tools/collections/payWithBankTransfer.js +55 -0
- package/build/tools/collections/payWithBankTransfer.js.map +1 -0
- package/build/tools/collections/processRefund.d.ts +7 -0
- package/build/tools/collections/processRefund.d.ts.map +1 -0
- package/build/tools/collections/processRefund.js +55 -0
- package/build/tools/collections/processRefund.js.map +1 -0
- package/build/tools/collections/reserveAccount.d.ts +7 -0
- package/build/tools/collections/reserveAccount.d.ts.map +1 -0
- package/build/tools/collections/reserveAccount.js +57 -0
- package/build/tools/collections/reserveAccount.js.map +1 -0
- package/build/tools/directDebit/cancelMandate.d.ts +7 -0
- package/build/tools/directDebit/cancelMandate.d.ts.map +1 -0
- package/build/tools/directDebit/cancelMandate.js +55 -0
- package/build/tools/directDebit/cancelMandate.js.map +1 -0
- package/build/tools/directDebit/createMandate.d.ts +7 -0
- package/build/tools/directDebit/createMandate.d.ts.map +1 -0
- package/build/tools/directDebit/createMandate.js +55 -0
- package/build/tools/directDebit/createMandate.js.map +1 -0
- package/build/tools/directDebit/debitMandate.d.ts +7 -0
- package/build/tools/directDebit/debitMandate.d.ts.map +1 -0
- package/build/tools/directDebit/debitMandate.js +55 -0
- package/build/tools/directDebit/debitMandate.js.map +1 -0
- package/build/tools/directDebit/getMandateDebitStatus.d.ts +7 -0
- package/build/tools/directDebit/getMandateDebitStatus.d.ts.map +1 -0
- package/build/tools/directDebit/getMandateDebitStatus.js +55 -0
- package/build/tools/directDebit/getMandateDebitStatus.js.map +1 -0
- package/build/tools/directDebit/getMandateStatus.d.ts +7 -0
- package/build/tools/directDebit/getMandateStatus.d.ts.map +1 -0
- package/build/tools/directDebit/getMandateStatus.js +55 -0
- package/build/tools/directDebit/getMandateStatus.js.map +1 -0
- package/build/tools/registry.d.ts +11 -0
- package/build/tools/registry.d.ts.map +1 -0
- package/build/tools/registry.js +15 -0
- package/build/tools/registry.js.map +1 -0
- package/build/tools/utilities/getSupportedBanks.d.ts +8 -0
- package/build/tools/utilities/getSupportedBanks.d.ts.map +1 -0
- package/build/tools/utilities/getSupportedBanks.js +47 -0
- package/build/tools/utilities/getSupportedBanks.js.map +1 -0
- package/build/tools/utilities/getTransactionList.d.ts +47 -0
- package/build/tools/utilities/getTransactionList.d.ts.map +1 -0
- package/build/tools/utilities/getTransactionList.js +136 -0
- package/build/tools/utilities/getTransactionList.js.map +1 -0
- package/build/tools/verification/verifyBankAccount.d.ts +7 -0
- package/build/tools/verification/verifyBankAccount.d.ts.map +1 -0
- package/build/tools/verification/verifyBankAccount.js +58 -0
- package/build/tools/verification/verifyBankAccount.js.map +1 -0
- package/build/tools/verification/verifyBvn.d.ts +7 -0
- package/build/tools/verification/verifyBvn.d.ts.map +1 -0
- package/build/tools/verification/verifyBvn.js +55 -0
- package/build/tools/verification/verifyBvn.js.map +1 -0
- package/build/tools/verification/verifyBvnInfo.d.ts +7 -0
- package/build/tools/verification/verifyBvnInfo.d.ts.map +1 -0
- package/build/tools/verification/verifyBvnInfo.js +55 -0
- package/build/tools/verification/verifyBvnInfo.js.map +1 -0
- package/build/tools/verification/verifyNin.d.ts +7 -0
- package/build/tools/verification/verifyNin.d.ts.map +1 -0
- package/build/tools/verification/verifyNin.js +55 -0
- package/build/tools/verification/verifyNin.js.map +1 -0
- package/build/transport/http.d.ts +3 -0
- package/build/transport/http.d.ts.map +1 -0
- package/build/transport/http.js +71 -0
- package/build/transport/http.js.map +1 -0
- package/build/transport/stdio.d.ts +3 -0
- package/build/transport/stdio.d.ts.map +1 -0
- package/build/transport/stdio.js +8 -0
- package/build/transport/stdio.js.map +1 -0
- package/build/types/mcp.d.ts +11 -0
- package/build/types/mcp.d.ts.map +1 -0
- package/build/types/mcp.js +7 -0
- package/build/types/mcp.js.map +1 -0
- package/build/utils/clientContext.d.ts +7 -0
- package/build/utils/clientContext.d.ts.map +1 -0
- package/build/utils/clientContext.js +24 -0
- package/build/utils/clientContext.js.map +1 -0
- package/build/utils/errors.d.ts +21 -0
- package/build/utils/errors.d.ts.map +1 -0
- package/build/utils/errors.js +45 -0
- package/build/utils/errors.js.map +1 -0
- package/build/utils/format.d.ts +34 -0
- package/build/utils/format.d.ts.map +1 -0
- package/build/utils/format.js +362 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/formatters.d.ts +4 -0
- package/build/utils/formatters.d.ts.map +1 -0
- package/build/utils/formatters.js +26 -0
- package/build/utils/formatters.js.map +1 -0
- package/build/utils/logger.d.ts +3 -0
- package/build/utils/logger.d.ts.map +1 -0
- package/build/utils/logger.js +30 -0
- package/build/utils/logger.js.map +1 -0
- package/openapi/monnify.yaml +9295 -0
- package/package.json +55 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiPost } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseAuthoriseCard3dsResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatAuthoriseCard3ds } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
import { AuthoriseCard3dsInputSchema } from "../../schemas/extended/collections.js";
|
|
11
|
+
import { tryEnv } from "../../config/env.js";
|
|
12
|
+
const definition = {
|
|
13
|
+
name: "monnify_authorise_card_3ds",
|
|
14
|
+
description: `Initiates 3D Secure (3DS) authorisation for a card transaction and returns the redirect URL for the customer to complete bank authentication.
|
|
15
|
+
|
|
16
|
+
WHEN TO USE: Only when monnify_charge_card returns status THREE_DS_TRANSACTION_INITIATED. Call this tool with the transactionReference and apiKey from the charge response to obtain the 3DS redirect URL, then direct the customer to that URL to complete authentication on their bank's page.
|
|
17
|
+
|
|
18
|
+
PREREQUISITES: monnify_charge_card must have been called and returned status THREE_DS_TRANSACTION_INITIATED. Both transactionReference and apiKey from that charge response are required.
|
|
19
|
+
|
|
20
|
+
SIDE EFFECTS: Prepares the 3DS authentication session on Monnify's end. After the customer completes authentication on the bank's 3DS page, the bank will redirect them back to the merchant's configured redirectUrl. Call monnify_get_transaction_status afterwards to confirm the final payment outcome.
|
|
21
|
+
|
|
22
|
+
MFA NOTE: 3DS authentication happens entirely on the customer's bank page — the bank issues and validates the OTP or biometric challenge. The merchant does not see the 3DS credential.
|
|
23
|
+
|
|
24
|
+
KEY OUTPUT FIELDS: redirectUrl (send the customer to this URL to complete 3DS authentication), status, transactionReference, paymentReference, authorizedAmount.`,
|
|
25
|
+
inputSchema: zodToJsonSchema(AuthoriseCard3dsInputSchema),
|
|
26
|
+
};
|
|
27
|
+
async function handler(args) {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = AuthoriseCard3dsInputSchema.parse(args);
|
|
30
|
+
const apiKey = parsed.apiKey ?? tryEnv()?.MONNIFY_API_KEY;
|
|
31
|
+
if (!apiKey) {
|
|
32
|
+
return {
|
|
33
|
+
content: [{ type: "text", text: "Validation failed:\n - apiKey: Required (or configure MONNIFY_API_KEY environment variable)" }],
|
|
34
|
+
isError: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const result = await apiPost("/api/v1/sdk/cards/secure-3d/authorize", { ...parsed, apiKey });
|
|
38
|
+
const sanitised = sanitiseAuthoriseCard3dsResponse(result);
|
|
39
|
+
return {
|
|
40
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatAuthoriseCard3ds(sanitised) }],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (error instanceof z.ZodError) {
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: `Validation failed:\n${error.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}`,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
isError: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
if (error instanceof MonnifyApiError) {
|
|
56
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
57
|
+
}
|
|
58
|
+
return errorResult(`monnify_authorise_card_3ds failed: ${String(error)}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
registerTool({ definition, handler });
|
|
62
|
+
export { definition, AuthoriseCard3dsInputSchema as inputSchema, handler };
|
|
63
|
+
//# sourceMappingURL=authoriseCard3ds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoriseCard3ds.js","sourceRoot":"","sources":["../../../src/tools/collections/authoriseCard3ds.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CA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AAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,SAAoC,CAAC,EAAE,CAAC;SACtK,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAChC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBAC3G;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACrC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC5D,CAAC;QACD,OAAO,WAAW,CAAC,sCAAsC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,YAAY,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,2BAA2B,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpToolResult } from "../../types/mcp.js";
|
|
3
|
+
import { AuthoriseCardOtpInputSchema } from "../../schemas/extended/collections.js";
|
|
4
|
+
declare const definition: Tool;
|
|
5
|
+
declare function handler(args: unknown): Promise<McpToolResult>;
|
|
6
|
+
export { definition, AuthoriseCardOtpInputSchema as inputSchema, handler };
|
|
7
|
+
//# sourceMappingURL=authoriseCardOtp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoriseCardOtp.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/authoriseCardOtp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAEpF,QAAA,MAAM,UAAU,EAAE,IAcjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CA4B5D;AAID,OAAO,EAAE,UAAU,EAAE,2BAA2B,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiPost } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseAuthoriseCardOtpResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatAuthoriseCardOtp } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
import { AuthoriseCardOtpInputSchema } from "../../schemas/extended/collections.js";
|
|
11
|
+
const definition = {
|
|
12
|
+
name: "monnify_authorise_card_otp",
|
|
13
|
+
description: `Completes a card transaction that is awaiting OTP (one-time password) authorisation.
|
|
14
|
+
|
|
15
|
+
WHEN TO USE: Only when monnify_charge_card returns status OTP_TRANSACTION_INITIATED. Collect the OTP the customer receives via SMS from their bank and pass it here to finalise the payment.
|
|
16
|
+
|
|
17
|
+
PREREQUISITES: monnify_charge_card must have been called and returned status OTP_TRANSACTION_INITIATED. The customer must have received and provided their bank OTP.
|
|
18
|
+
|
|
19
|
+
SIDE EFFECTS: Submits the OTP to the card network for verification. A SUCCESS status means the payment is complete. A FAILED status means the OTP was incorrect or expired — the customer must retry the charge.
|
|
20
|
+
|
|
21
|
+
MFA NOTE: The OTP is issued by the customer's bank, not Monnify. It is typically 6 digits and valid for a short window (1–5 minutes). Never store or log OTP values.
|
|
22
|
+
|
|
23
|
+
KEY OUTPUT FIELDS: status (SUCCESS or FAILED), transactionReference, paymentReference, authorizedAmount, message.`,
|
|
24
|
+
inputSchema: zodToJsonSchema(AuthoriseCardOtpInputSchema),
|
|
25
|
+
};
|
|
26
|
+
async function handler(args) {
|
|
27
|
+
try {
|
|
28
|
+
const parsed = AuthoriseCardOtpInputSchema.parse(args);
|
|
29
|
+
const result = await apiPost("/api/v1/merchant/cards/otp/authorize", parsed);
|
|
30
|
+
const sanitised = sanitiseAuthoriseCardOtpResponse(result);
|
|
31
|
+
return {
|
|
32
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatAuthoriseCardOtp(sanitised) }],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof z.ZodError) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `Validation failed:\n${error.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}`,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (error instanceof MonnifyApiError) {
|
|
48
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
49
|
+
}
|
|
50
|
+
return errorResult(`monnify_authorise_card_otp failed: ${String(error)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
registerTool({ definition, handler });
|
|
54
|
+
export { definition, AuthoriseCardOtpInputSchema as inputSchema, handler };
|
|
55
|
+
//# sourceMappingURL=authoriseCardOtp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoriseCardOtp.js","sourceRoot":"","sources":["../../../src/tools/collections/authoriseCardOtp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAEpF,MAAM,UAAU,GAAS;IACvB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE;;;;;;;;;;kHAUmG;IAChH,WAAW,EAAE,eAAe,CAAC,2BAA2B,CAAwB;CACjF,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAa;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,sCAAsC,EACtC,MAAM,CACP,CAAC;QACF,MAAM,SAAS,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;QAC3D,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,SAAoC,CAAC,EAAE,CAAC;SACtK,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC;YAChC,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBAC3G;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACrC,OAAO,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC5D,CAAC;QACD,OAAO,WAAW,CAAC,sCAAsC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,YAAY,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,2BAA2B,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import type { McpToolResult } from "../../types/mcp.js";
|
|
3
|
+
import { ChargeCardInputSchema } from "../../schemas/extended/collections.js";
|
|
4
|
+
declare const definition: Tool;
|
|
5
|
+
declare function handler(args: unknown): Promise<McpToolResult>;
|
|
6
|
+
export { definition, ChargeCardInputSchema as inputSchema, handler };
|
|
7
|
+
//# sourceMappingURL=chargeCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chargeCard.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/chargeCard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,QAAA,MAAM,UAAU,EAAE,IAkBjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CA4B5D;AAID,OAAO,EAAE,UAAU,EAAE,qBAAqB,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiPost } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseChargeCardResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatChargeCard } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
import { ChargeCardInputSchema } from "../../schemas/extended/collections.js";
|
|
11
|
+
const definition = {
|
|
12
|
+
name: "monnify_charge_card",
|
|
13
|
+
description: `Charges a customer's card against an existing pending transaction using card details collected by the merchant.
|
|
14
|
+
|
|
15
|
+
WHEN TO USE: After calling monnify_initiate_payment, use this tool to directly charge a card when you have collected card details on your own payment form (not via the checkoutUrl). The transaction must already exist and be in PENDING status.
|
|
16
|
+
|
|
17
|
+
PREREQUISITES: A pending transaction must already exist — call monnify_initiate_payment first and pass its transactionReference here. Card details and browser deviceInformation must be collected from the customer's browser. Never log or store raw card numbers, CVVs, or PINs.
|
|
18
|
+
|
|
19
|
+
SIDE EFFECTS: Attempts to charge the card immediately. The response status determines the next step:
|
|
20
|
+
- SUCCESS → payment is complete, no further action needed
|
|
21
|
+
- OTP_AUTHORIZATION_REQUIRED → card requires OTP; otpData.message tells the customer where to get it. Collect the OTP and call monnify_authorise_card_otp
|
|
22
|
+
- BANK_AUTHORIZATION_REQUIRED → card requires 3DS; redirect customer to secure3dData.redirectUrl, then call monnify_authorise_card_3ds
|
|
23
|
+
- FAILED → charge failed; surface the message to the customer
|
|
24
|
+
|
|
25
|
+
MFA NOTE: Nigerian-issued cards require card.pin and may also trigger OTP or 3DS. Always handle all three non-SUCCESS statuses.
|
|
26
|
+
|
|
27
|
+
KEY OUTPUT FIELDS: status (determines next step), transactionReference, paymentReference, authorizedAmount, message, otpData (for OTP flow — contains id and message), secure3dData (for 3DS flow — contains id and redirectUrl).`,
|
|
28
|
+
inputSchema: zodToJsonSchema(ChargeCardInputSchema),
|
|
29
|
+
};
|
|
30
|
+
async function handler(args) {
|
|
31
|
+
try {
|
|
32
|
+
const parsed = ChargeCardInputSchema.parse(args);
|
|
33
|
+
const result = await apiPost("/api/v1/merchant/cards/charge", parsed);
|
|
34
|
+
const sanitised = sanitiseChargeCardResponse(result);
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatChargeCard(sanitised) }],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error instanceof z.ZodError) {
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Validation failed:\n${error.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (error instanceof MonnifyApiError) {
|
|
52
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
53
|
+
}
|
|
54
|
+
return errorResult(`monnify_charge_card failed: ${String(error)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
registerTool({ definition, handler });
|
|
58
|
+
export { definition, ChargeCardInputSchema as inputSchema, handler };
|
|
59
|
+
//# sourceMappingURL=chargeCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chargeCard.js","sourceRoot":"","sources":["../../../src/tools/collections/chargeCard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,MAAM,UAAU,GAAS;IACvB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;;;;;;;;;;;;;kOAcmN;IAChO,WAAW,EAAE,eAAe,CAAC,qBAAqB,CAAwB;CAC3E,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAa;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,OAAO,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otocol/sdk/types.js";
|
|
2
|
+
import type { McpToolResult } from "../../types/mcp.js";
|
|
3
|
+
import { ChargeCardTokenInputSchema } from "../../schemas/extended/collections.js";
|
|
4
|
+
declare const definition: Tool;
|
|
5
|
+
declare function handler(args: unknown): Promise<McpToolResult>;
|
|
6
|
+
export { definition, ChargeCardTokenInputSchema as inputSchema, handler };
|
|
7
|
+
//# sourceMappingURL=chargeCardToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chargeCardToken.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/chargeCardToken.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAGnF,QAAA,MAAM,UAAU,EAAE,IAcjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAwC5D;AAID,OAAO,EAAE,UAAU,EAAE,0BAA0B,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiPost } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseChargeCardTokenResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatChargeCardToken } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
import { ChargeCardTokenInputSchema } from "../../schemas/extended/collections.js";
|
|
11
|
+
import { tryEnv } from "../../config/env.js";
|
|
12
|
+
const definition = {
|
|
13
|
+
name: "monnify_charge_card_token",
|
|
14
|
+
description: `Charges a previously tokenized card using its card token, without requiring the customer to re-enter card details.
|
|
15
|
+
|
|
16
|
+
WHEN TO USE: For recurring or repeat charges on a card the customer has already paid with. The card token is obtained from monnify_get_transaction_status after a previous successful card charge — look for the cardToken field in the response.
|
|
17
|
+
|
|
18
|
+
PREREQUISITES: A card token from a prior successful charge. Store the cardToken alongside the customerEmail used in that original charge — both are required here. The token is tied to the merchant's contractCode and apiKey.
|
|
19
|
+
|
|
20
|
+
SIDE EFFECTS: Initiates a real card charge immediately. This is a financial transaction — use a unique paymentReference per charge attempt. The same paymentReference can be safely resubmitted to deduplicate retries without double-charging.
|
|
21
|
+
|
|
22
|
+
MFA NOTE: Token charges bypass OTP and 3DS — the customer authorised recurring charges when they first paid. Ensure you have the customer's explicit consent to store and reuse their card token.
|
|
23
|
+
|
|
24
|
+
KEY OUTPUT FIELDS: transactionReference, paymentReference, amountPaid, totalPayable, settlementAmount, paidOn, paymentStatus (PAID | FAILED), paymentMethod, currency.`,
|
|
25
|
+
inputSchema: zodToJsonSchema(ChargeCardTokenInputSchema),
|
|
26
|
+
};
|
|
27
|
+
async function handler(args) {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = ChargeCardTokenInputSchema.parse(args);
|
|
30
|
+
const contractCode = parsed.contractCode ?? tryEnv()?.MONNIFY_CONTRACT_CODE;
|
|
31
|
+
const apiKey = parsed.apiKey ?? tryEnv()?.MONNIFY_API_KEY;
|
|
32
|
+
if (!contractCode || !apiKey) {
|
|
33
|
+
const missing = [
|
|
34
|
+
!contractCode && " - contractCode: Required (or configure MONNIFY_CONTRACT_CODE environment variable)",
|
|
35
|
+
!apiKey && " - apiKey: Required (or configure MONNIFY_API_KEY environment variable)",
|
|
36
|
+
].filter(Boolean).join("\n");
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: "text", text: `Validation failed:\n${missing}` }],
|
|
39
|
+
isError: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const result = await apiPost("/api/v1/merchant/cards/charge-card-token", { ...parsed, contractCode, apiKey });
|
|
43
|
+
const sanitised = sanitiseChargeCardTokenResponse(result);
|
|
44
|
+
return {
|
|
45
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatChargeCardToken(sanitised) }],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error instanceof z.ZodError) {
|
|
50
|
+
return {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: `Validation failed:\n${error.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}`,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (error instanceof MonnifyApiError) {
|
|
61
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
62
|
+
}
|
|
63
|
+
return errorResult(`monnify_charge_card_token failed: ${String(error)}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
registerTool({ definition, handler });
|
|
67
|
+
export { definition, ChargeCardTokenInputSchema as inputSchema, handler };
|
|
68
|
+
//# sourceMappingURL=chargeCardToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chargeCardToken.js","sourceRoot":"","sources":["../../../src/tools/collections/chargeCardToken.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD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from "../../schemas/extended/collections.js";
|
|
4
|
+
declare const definition: Tool;
|
|
5
|
+
declare function handler(args: unknown): Promise<McpToolResult>;
|
|
6
|
+
export { definition, CreateInvoiceInputSchema as inputSchema, handler };
|
|
7
|
+
//# sourceMappingURL=createInvoice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInvoice.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/createInvoice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAGjF,QAAA,MAAM,UAAU,EAAE,IAcjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CA6B5D;AAID,OAAO,EAAE,UAAU,EAAE,wBAAwB,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiPost } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseInvoiceResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatCreateInvoice } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
import { CreateInvoiceInputSchema } from "../../schemas/extended/collections.js";
|
|
11
|
+
import { env } from "../../config/env.js";
|
|
12
|
+
const definition = {
|
|
13
|
+
name: "monnify_create_invoice",
|
|
14
|
+
description: `Creates a payment invoice and returns a URL the customer can use to pay.
|
|
15
|
+
|
|
16
|
+
WHEN TO USE: When you need to send a customer a formal invoice with a fixed amount and expiry date. Suitable for B2B billing, service charges, or any scenario where you want a shareable payment link with a deadline.
|
|
17
|
+
|
|
18
|
+
PREREQUISITES: None. A Monnify contract code is required.
|
|
19
|
+
|
|
20
|
+
SIDE EFFECTS: Creates an invoice record on Monnify. The invoice remains active until the expiryDate or until paid. Using the same invoiceReference is safe (idempotent).
|
|
21
|
+
|
|
22
|
+
MFA NOTE: Not applicable at the invoice creation stage.
|
|
23
|
+
|
|
24
|
+
KEY OUTPUT FIELDS: invoiceReference, invoiceStatus, checkoutUrl (share with customer), invoiceUrl, offlinePaymentCode, expiryDate, createdOn.`,
|
|
25
|
+
inputSchema: zodToJsonSchema(CreateInvoiceInputSchema),
|
|
26
|
+
};
|
|
27
|
+
async function handler(args) {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = CreateInvoiceInputSchema.parse(args);
|
|
30
|
+
const contractCode = parsed.contractCode ?? env().MONNIFY_CONTRACT_CODE;
|
|
31
|
+
const result = await apiPost("/api/v1/invoice/create", parsed);
|
|
32
|
+
const sanitised = sanitiseInvoiceResponse(result);
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatCreateInvoice(sanitised) }],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (error instanceof z.ZodError) {
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: `Validation failed:\n${error.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}`,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
isError: true,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (error instanceof MonnifyApiError) {
|
|
50
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
51
|
+
}
|
|
52
|
+
return errorResult(`monnify_create_invoice failed: ${String(error)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
registerTool({ definition, handler });
|
|
56
|
+
export { definition, CreateInvoiceInputSchema as inputSchema, handler };
|
|
57
|
+
//# sourceMappingURL=createInvoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInvoice.js","sourceRoot":"","sources":["../../../src/tools/collections/createInvoice.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,UAAU,GAAS;IACvB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE;;;;;;;;;;8IAU+H;IAC5I,WAAW,EAAE,eAAe,CAAC,wBAAwB,CAAwB;CAC9E,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAa;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,GAAG,EAAE,CAAC,qBAAqB,CAAC;QACxE,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,wBAAwB,EACxB,MAAM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import { z } from "zod";
|
|
3
|
+
import type { McpToolResult } from "../../types/mcp.js";
|
|
4
|
+
declare const InputSchema: z.ZodObject<{
|
|
5
|
+
accountReference: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
accountReference: string;
|
|
8
|
+
}, {
|
|
9
|
+
accountReference: string;
|
|
10
|
+
}>;
|
|
11
|
+
declare const definition: Tool;
|
|
12
|
+
declare function handler(args: unknown): Promise<McpToolResult>;
|
|
13
|
+
export { definition, InputSchema as inputSchema, handler };
|
|
14
|
+
//# sourceMappingURL=deallocateReservedAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deallocateReservedAccount.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/deallocateReservedAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASxD,QAAA,MAAM,WAAW;;;;;;EAKf,CAAC;AAEH,QAAA,MAAM,UAAU,EAAE,IAcjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAsB5D;AAID,OAAO,EAAE,UAAU,EAAE,WAAW,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
|
+
import { apiDelete } from "../../client/monnifyClient.js";
|
|
4
|
+
import { sanitiseDeallocateAccountResponse } from "../../security/sanitiser.js";
|
|
5
|
+
import { registerTool } from "../registry.js";
|
|
6
|
+
import { MonnifyApiError } from "../../utils/errors.js";
|
|
7
|
+
import { errorResult } from "../../types/mcp.js";
|
|
8
|
+
import { formatDeallocateAccount } from "../../utils/format.js";
|
|
9
|
+
import { getResponseFormat } from "../../utils/clientContext.js";
|
|
10
|
+
const InputSchema = z.object({
|
|
11
|
+
accountReference: z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.describe("The unique reference of the reserved account to permanently remove."),
|
|
15
|
+
});
|
|
16
|
+
const definition = {
|
|
17
|
+
name: "monnify_deallocate_reserved_account",
|
|
18
|
+
description: `Permanently deletes a reserved account. The virtual account numbers will no longer accept payments.
|
|
19
|
+
|
|
20
|
+
WHEN TO USE: When a customer closes their account, a wallet is terminated, or a reserved account is no longer needed. This action is irreversible.
|
|
21
|
+
|
|
22
|
+
PREREQUISITES: The reserved account must exist and be in an active state.
|
|
23
|
+
|
|
24
|
+
SIDE EFFECTS: DESTRUCTIVE — permanently removes the reserved account. Any payments sent to the virtual account numbers after deallocation will be rejected or returned. Cannot be undone.
|
|
25
|
+
|
|
26
|
+
MFA NOTE: Not applicable.
|
|
27
|
+
|
|
28
|
+
KEY OUTPUT FIELDS: accountReference, accountName, status (confirms deallocation).`,
|
|
29
|
+
inputSchema: zodToJsonSchema(InputSchema),
|
|
30
|
+
};
|
|
31
|
+
async function handler(args) {
|
|
32
|
+
try {
|
|
33
|
+
const parsed = InputSchema.parse(args);
|
|
34
|
+
const result = await apiDelete(`/api/v1/bank-transfer/reserved-accounts/reference/${encodeURIComponent(parsed.accountReference)}`);
|
|
35
|
+
const sanitised = sanitiseDeallocateAccountResponse(result);
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: "text", text: getResponseFormat() === "json" ? JSON.stringify(sanitised, null, 2) : formatDeallocateAccount(sanitised) }],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (error instanceof z.ZodError) {
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: "text", text: `Validation failed:\n${error.issues.map(i => ` - ${i.path.join(".")}: ${i.message}`).join("\n")}` }],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (error instanceof MonnifyApiError) {
|
|
48
|
+
return { content: [error.toMcpContent()], isError: true };
|
|
49
|
+
}
|
|
50
|
+
return errorResult(`monnify_deallocate_reserved_account failed: ${String(error)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
registerTool({ definition, handler });
|
|
54
|
+
export { definition, InputSchema as inputSchema, handler };
|
|
55
|
+
//# sourceMappingURL=deallocateReservedAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deallocateReservedAccount.js","sourceRoot":"","sources":["../../../src/tools/collections/deallocateReservedAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,gBAAgB,EAAE,CAAC;SAChB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,qEAAqE,CAAC;CACnF,CAAC,CAAC;AAEH,MAAM,UAAU,GAAS;IACvB,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE;;;;;;;;;;kFAUmE;IAChF,WAAW,EAAE,eAAe,CAAC,WAAW,CAAwB;CACjE,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,IAAa;IA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C,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,WAAW,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { McpToolResult } from "../../types/mcp.js";
|
|
4
|
+
declare const InputSchema: z.ZodObject<{
|
|
5
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
size: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
from: z.ZodOptional<z.ZodString>;
|
|
8
|
+
to: z.ZodOptional<z.ZodString>;
|
|
9
|
+
paymentStatus: z.ZodOptional<z.ZodEnum<["PAID", "PENDING", "CANCELLED", "FAILED"]>>;
|
|
10
|
+
paymentReference: z.ZodOptional<z.ZodString>;
|
|
11
|
+
transactionReference: z.ZodOptional<z.ZodString>;
|
|
12
|
+
customerName: z.ZodOptional<z.ZodString>;
|
|
13
|
+
customerEmail: z.ZodOptional<z.ZodString>;
|
|
14
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
fromAmount: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
toAmount: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
size: number;
|
|
19
|
+
page: number;
|
|
20
|
+
transactionReference?: string | undefined;
|
|
21
|
+
paymentReference?: string | undefined;
|
|
22
|
+
paymentStatus?: "PAID" | "FAILED" | "CANCELLED" | "PENDING" | undefined;
|
|
23
|
+
customerEmail?: string | undefined;
|
|
24
|
+
customerName?: string | undefined;
|
|
25
|
+
amount?: number | undefined;
|
|
26
|
+
from?: string | undefined;
|
|
27
|
+
to?: string | undefined;
|
|
28
|
+
fromAmount?: number | undefined;
|
|
29
|
+
toAmount?: number | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
transactionReference?: string | undefined;
|
|
32
|
+
paymentReference?: string | undefined;
|
|
33
|
+
paymentStatus?: "PAID" | "FAILED" | "CANCELLED" | "PENDING" | undefined;
|
|
34
|
+
customerEmail?: string | undefined;
|
|
35
|
+
customerName?: string | undefined;
|
|
36
|
+
amount?: number | undefined;
|
|
37
|
+
size?: number | undefined;
|
|
38
|
+
page?: number | undefined;
|
|
39
|
+
from?: string | undefined;
|
|
40
|
+
to?: string | undefined;
|
|
41
|
+
fromAmount?: number | undefined;
|
|
42
|
+
toAmount?: number | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
declare const definition: Tool;
|
|
45
|
+
declare function handler(args: z.infer<typeof InputSchema>): Promise<McpToolResult>;
|
|
46
|
+
export { definition, InputSchema as inputSchema, handler };
|
|
47
|
+
//# sourceMappingURL=getAllTransactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllTransactions.d.ts","sourceRoot":"","sources":["../../../src/tools/collections/getAllTransactions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Df,CAAC;AAEH,QAAA,MAAM,UAAU,EAAE,IAcjB,CAAC;AAEF,iBAAe,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CA0DhF;AAID,OAAO,EAAE,UAAU,EAAE,WAAW,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC"}
|