@guiie/buda-mcp 1.4.2 → 1.5.1
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/.cursor/rules/marketplace-docs-sync.mdc +32 -0
- package/CHANGELOG.md +79 -0
- package/PUBLISH_CHECKLIST.md +40 -88
- package/README.md +446 -78
- package/dist/cache.d.ts +1 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +18 -1
- package/dist/http.js +97 -6
- package/dist/index.js +42 -3
- package/dist/tools/account.d.ts +19 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +49 -0
- package/dist/tools/balance.d.ts +29 -0
- package/dist/tools/balance.d.ts.map +1 -0
- package/dist/tools/balance.js +72 -0
- package/dist/tools/banks.d.ts +28 -0
- package/dist/tools/banks.d.ts.map +1 -0
- package/dist/tools/banks.js +68 -0
- package/dist/tools/batch_orders.d.ts +82 -0
- package/dist/tools/batch_orders.d.ts.map +1 -0
- package/dist/tools/batch_orders.js +188 -0
- package/dist/tools/cancel_all_orders.d.ts +34 -0
- package/dist/tools/cancel_all_orders.d.ts.map +1 -0
- package/dist/tools/cancel_all_orders.js +89 -0
- package/dist/tools/cancel_order.js +1 -1
- package/dist/tools/cancel_order_by_client_id.d.ts +34 -0
- package/dist/tools/cancel_order_by_client_id.d.ts.map +1 -0
- package/dist/tools/cancel_order_by_client_id.js +102 -0
- package/dist/tools/dead_mans_switch.d.ts +1 -1
- package/dist/tools/dead_mans_switch.d.ts.map +1 -1
- package/dist/tools/dead_mans_switch.js +33 -3
- package/dist/tools/deposits.d.ts +83 -0
- package/dist/tools/deposits.d.ts.map +1 -0
- package/dist/tools/deposits.js +174 -0
- package/dist/tools/fees.d.ts +34 -0
- package/dist/tools/fees.d.ts.map +1 -0
- package/dist/tools/fees.js +72 -0
- package/dist/tools/lightning.d.ts +68 -0
- package/dist/tools/lightning.d.ts.map +1 -0
- package/dist/tools/lightning.js +185 -0
- package/dist/tools/order_lookup.d.ts +50 -0
- package/dist/tools/order_lookup.d.ts.map +1 -0
- package/dist/tools/order_lookup.js +112 -0
- package/dist/tools/place_order.d.ts +30 -0
- package/dist/tools/place_order.d.ts.map +1 -1
- package/dist/tools/place_order.js +131 -2
- package/dist/tools/quotation.d.ts +44 -0
- package/dist/tools/quotation.d.ts.map +1 -0
- package/dist/tools/quotation.js +99 -0
- package/dist/tools/receive_addresses.d.ts +83 -0
- package/dist/tools/receive_addresses.d.ts.map +1 -0
- package/dist/tools/receive_addresses.js +185 -0
- package/dist/tools/remittance_recipients.d.ts +54 -0
- package/dist/tools/remittance_recipients.d.ts.map +1 -0
- package/dist/tools/remittance_recipients.js +106 -0
- package/dist/tools/remittances.d.ts +120 -0
- package/dist/tools/remittances.d.ts.map +1 -0
- package/dist/tools/remittances.js +261 -0
- package/dist/tools/simulate_order.d.ts.map +1 -1
- package/dist/tools/simulate_order.js +2 -1
- package/dist/tools/technical_indicators.d.ts.map +1 -1
- package/dist/tools/technical_indicators.js +2 -1
- package/dist/tools/withdrawals.d.ts +93 -0
- package/dist/tools/withdrawals.d.ts.map +1 -0
- package/dist/tools/withdrawals.js +225 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -1
- package/dist/validation.d.ts +11 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +38 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +8 -1
- package/marketplace/README.md +1 -1
- package/marketplace/claude-listing.md +101 -2
- package/marketplace/gemini-tools.json +478 -1
- package/marketplace/openapi.yaml +160 -1
- package/package.json +2 -1
- package/server.json +2 -2
- package/src/cache.ts +1 -0
- package/src/client.ts +23 -1
- package/src/http.ts +105 -6
- package/src/index.ts +40 -3
- package/src/tools/account.ts +66 -0
- package/src/tools/balance.ts +94 -0
- package/src/tools/banks.ts +94 -0
- package/src/tools/batch_orders.ts +238 -0
- package/src/tools/cancel_all_orders.ts +117 -0
- package/src/tools/cancel_order.ts +1 -1
- package/src/tools/cancel_order_by_client_id.ts +132 -0
- package/src/tools/dead_mans_switch.ts +39 -3
- package/src/tools/deposits.ts +230 -0
- package/src/tools/fees.ts +91 -0
- package/src/tools/lightning.ts +247 -0
- package/src/tools/order_lookup.ts +139 -0
- package/src/tools/place_order.ts +151 -2
- package/src/tools/quotation.ts +124 -0
- package/src/tools/receive_addresses.ts +242 -0
- package/src/tools/remittance_recipients.ts +139 -0
- package/src/tools/remittances.ts +325 -0
- package/src/tools/simulate_order.ts +1 -0
- package/src/tools/technical_indicators.ts +2 -1
- package/src/tools/withdrawals.ts +287 -0
- package/src/types.ts +210 -0
- package/src/utils.ts +3 -1
- package/src/validation.ts +45 -0
- package/src/version.ts +11 -3
- package/test/run-all.ts +16 -0
- package/test/unit.ts +2149 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BudaApiError } from "../client.js";
|
|
3
|
+
import { validateCurrency } from "../validation.js";
|
|
4
|
+
export const createReceiveAddressToolSchema = {
|
|
5
|
+
name: "create_receive_address",
|
|
6
|
+
description: "Generates a new receive address for a crypto currency. " +
|
|
7
|
+
"Creates a new blockchain deposit address for the given currency. " +
|
|
8
|
+
"Each call generates a distinct address. Not idempotent. " +
|
|
9
|
+
"IMPORTANT: Pass confirmation_token='CONFIRM' to execute. " +
|
|
10
|
+
"Only applicable to crypto currencies (BTC, ETH, etc.). " +
|
|
11
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
12
|
+
"Example: 'Give me a fresh Bitcoin deposit address.'",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
currency: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Currency code (e.g. 'BTC', 'ETH').",
|
|
19
|
+
},
|
|
20
|
+
confirmation_token: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Safety confirmation. Must equal exactly 'CONFIRM' (case-sensitive) to generate a new address.",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
required: ["currency", "confirmation_token"],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const listReceiveAddressesToolSchema = {
|
|
29
|
+
name: "list_receive_addresses",
|
|
30
|
+
description: "Lists all receive (deposit) addresses for a crypto currency on the authenticated Buda.com account. " +
|
|
31
|
+
"Returns an empty array if no addresses have been created yet. " +
|
|
32
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
33
|
+
"Example: 'What are my Bitcoin deposit addresses?'",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
currency: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Currency code (e.g. 'BTC', 'ETH').",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ["currency"],
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export const getReceiveAddressToolSchema = {
|
|
46
|
+
name: "get_receive_address",
|
|
47
|
+
description: "Returns a single receive address by its ID for a given currency on Buda.com. " +
|
|
48
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
49
|
+
"Example: 'Get the details of my BTC receive address ID 42.'",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
currency: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Currency code (e.g. 'BTC', 'ETH').",
|
|
56
|
+
},
|
|
57
|
+
id: {
|
|
58
|
+
type: "number",
|
|
59
|
+
description: "The numeric ID of the receive address.",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: ["currency", "id"],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
function normalizeAddress(a) {
|
|
66
|
+
return {
|
|
67
|
+
id: a.id,
|
|
68
|
+
address: a.address,
|
|
69
|
+
currency: a.currency,
|
|
70
|
+
created_at: a.created_at,
|
|
71
|
+
label: a.label ?? null,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export async function handleListReceiveAddresses(args, client) {
|
|
75
|
+
const { currency } = args;
|
|
76
|
+
const validationError = validateCurrency(currency);
|
|
77
|
+
if (validationError) {
|
|
78
|
+
return {
|
|
79
|
+
content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
|
|
80
|
+
isError: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const data = await client.get(`/currencies/${currency.toUpperCase()}/receive_addresses`);
|
|
85
|
+
return {
|
|
86
|
+
content: [
|
|
87
|
+
{
|
|
88
|
+
type: "text",
|
|
89
|
+
text: JSON.stringify({ receive_addresses: data.receive_addresses.map(normalizeAddress) }, null, 2),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
const msg = err instanceof BudaApiError
|
|
96
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
97
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
98
|
+
return {
|
|
99
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
100
|
+
isError: true,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export async function handleGetReceiveAddress(args, client) {
|
|
105
|
+
const { currency, id } = args;
|
|
106
|
+
const validationError = validateCurrency(currency);
|
|
107
|
+
if (validationError) {
|
|
108
|
+
return {
|
|
109
|
+
content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
|
|
110
|
+
isError: true,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
const data = await client.get(`/currencies/${currency.toUpperCase()}/receive_addresses/${id}`);
|
|
115
|
+
return {
|
|
116
|
+
content: [{ type: "text", text: JSON.stringify(normalizeAddress(data.receive_address), null, 2) }],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
const msg = err instanceof BudaApiError
|
|
121
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
122
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
123
|
+
return {
|
|
124
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
125
|
+
isError: true,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export async function handleCreateReceiveAddress(args, client) {
|
|
130
|
+
const { currency, confirmation_token } = args;
|
|
131
|
+
if (confirmation_token !== "CONFIRM") {
|
|
132
|
+
return {
|
|
133
|
+
content: [
|
|
134
|
+
{
|
|
135
|
+
type: "text",
|
|
136
|
+
text: JSON.stringify({
|
|
137
|
+
error: "Address not generated. confirmation_token must equal 'CONFIRM' to execute. " +
|
|
138
|
+
"Each call creates a distinct address — review and set confirmation_token='CONFIRM' to proceed.",
|
|
139
|
+
code: "CONFIRMATION_REQUIRED",
|
|
140
|
+
preview: { currency },
|
|
141
|
+
}),
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
isError: true,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const validationError = validateCurrency(currency);
|
|
148
|
+
if (validationError) {
|
|
149
|
+
return {
|
|
150
|
+
content: [{ type: "text", text: JSON.stringify({ error: validationError, code: "INVALID_CURRENCY" }) }],
|
|
151
|
+
isError: true,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const data = await client.post(`/currencies/${currency.toUpperCase()}/receive_addresses`, {});
|
|
156
|
+
return {
|
|
157
|
+
content: [{ type: "text", text: JSON.stringify(normalizeAddress(data.receive_address), null, 2) }],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
catch (err) {
|
|
161
|
+
const msg = err instanceof BudaApiError
|
|
162
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
163
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
164
|
+
return {
|
|
165
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
166
|
+
isError: true,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
export function register(server, client) {
|
|
171
|
+
server.tool(listReceiveAddressesToolSchema.name, listReceiveAddressesToolSchema.description, {
|
|
172
|
+
currency: z.string().min(2).max(10).describe("Currency code (e.g. 'BTC', 'ETH')."),
|
|
173
|
+
}, (args) => handleListReceiveAddresses(args, client));
|
|
174
|
+
server.tool(getReceiveAddressToolSchema.name, getReceiveAddressToolSchema.description, {
|
|
175
|
+
currency: z.string().min(2).max(10).describe("Currency code (e.g. 'BTC', 'ETH')."),
|
|
176
|
+
id: z.number().int().positive().describe("The numeric ID of the receive address."),
|
|
177
|
+
}, (args) => handleGetReceiveAddress(args, client));
|
|
178
|
+
server.tool(createReceiveAddressToolSchema.name, createReceiveAddressToolSchema.description, {
|
|
179
|
+
currency: z.string().min(2).max(10).describe("Currency code (e.g. 'BTC', 'ETH')."),
|
|
180
|
+
confirmation_token: z
|
|
181
|
+
.string()
|
|
182
|
+
.describe("Safety confirmation. Must equal exactly 'CONFIRM' (case-sensitive) to generate a new address."),
|
|
183
|
+
}, (args) => handleCreateReceiveAddress(args, client));
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=receive_addresses.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { BudaClient } from "../client.js";
|
|
3
|
+
export declare const listToolSchema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
per: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
page: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const getToolSchema: {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object";
|
|
25
|
+
properties: {
|
|
26
|
+
id: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare function handleListRemittanceRecipients(args: {
|
|
35
|
+
per?: number;
|
|
36
|
+
page?: number;
|
|
37
|
+
}, client: BudaClient): Promise<{
|
|
38
|
+
content: Array<{
|
|
39
|
+
type: "text";
|
|
40
|
+
text: string;
|
|
41
|
+
}>;
|
|
42
|
+
isError?: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
export declare function handleGetRemittanceRecipient(args: {
|
|
45
|
+
id: number;
|
|
46
|
+
}, client: BudaClient): Promise<{
|
|
47
|
+
content: Array<{
|
|
48
|
+
type: "text";
|
|
49
|
+
text: string;
|
|
50
|
+
}>;
|
|
51
|
+
isError?: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
export declare function register(server: McpServer, client: BudaClient): void;
|
|
54
|
+
//# sourceMappingURL=remittance_recipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remittance_recipients.d.ts","sourceRoot":"","sources":["../../src/tools/remittance_recipients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAGxD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;CAoB1B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAiBzB,CAAC;AAaF,wBAAsB,8BAA8B,CAClD,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAoChF;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACpB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAgBhF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAmBpE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BudaApiError } from "../client.js";
|
|
3
|
+
export const listToolSchema = {
|
|
4
|
+
name: "list_remittance_recipients",
|
|
5
|
+
description: "Lists all saved remittance recipients (bank accounts) for the authenticated Buda.com account. " +
|
|
6
|
+
"Supports pagination. " +
|
|
7
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
8
|
+
"Example: 'Who are my saved remittance recipients?'",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
per: {
|
|
13
|
+
type: "number",
|
|
14
|
+
description: "Results per page (default: 20, max: 300).",
|
|
15
|
+
},
|
|
16
|
+
page: {
|
|
17
|
+
type: "number",
|
|
18
|
+
description: "Page number (default: 1).",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export const getToolSchema = {
|
|
24
|
+
name: "get_remittance_recipient",
|
|
25
|
+
description: "Returns a single saved remittance recipient by its ID on Buda.com. " +
|
|
26
|
+
"Fetches saved bank details for one recipient. " +
|
|
27
|
+
"Requires BUDA_API_KEY and BUDA_API_SECRET. " +
|
|
28
|
+
"Example: 'Show remittance recipient ID 5.'",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
id: {
|
|
33
|
+
type: "number",
|
|
34
|
+
description: "The numeric ID of the remittance recipient.",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["id"],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function normalizeRecipient(r) {
|
|
41
|
+
return {
|
|
42
|
+
id: r.id,
|
|
43
|
+
name: r.name,
|
|
44
|
+
bank: r.bank,
|
|
45
|
+
account_number: r.account_number,
|
|
46
|
+
currency: r.currency,
|
|
47
|
+
country: r.country ?? null,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export async function handleListRemittanceRecipients(args, client) {
|
|
51
|
+
try {
|
|
52
|
+
const params = {};
|
|
53
|
+
if (args.per !== undefined)
|
|
54
|
+
params.per = args.per;
|
|
55
|
+
if (args.page !== undefined)
|
|
56
|
+
params.page = args.page;
|
|
57
|
+
const data = await client.get("/remittance_recipients", Object.keys(params).length > 0 ? params : undefined);
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: JSON.stringify({
|
|
63
|
+
remittance_recipients: data.remittance_recipients.map(normalizeRecipient),
|
|
64
|
+
meta: data.meta,
|
|
65
|
+
}, null, 2),
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
const msg = err instanceof BudaApiError
|
|
72
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
73
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
74
|
+
return {
|
|
75
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
76
|
+
isError: true,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export async function handleGetRemittanceRecipient(args, client) {
|
|
81
|
+
try {
|
|
82
|
+
const data = await client.get(`/remittance_recipients/${args.id}`);
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: "text", text: JSON.stringify(normalizeRecipient(data.remittance_recipient), null, 2) }],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
const msg = err instanceof BudaApiError
|
|
89
|
+
? { error: err.message, code: err.status, path: err.path }
|
|
90
|
+
: { error: String(err), code: "UNKNOWN" };
|
|
91
|
+
return {
|
|
92
|
+
content: [{ type: "text", text: JSON.stringify(msg) }],
|
|
93
|
+
isError: true,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export function register(server, client) {
|
|
98
|
+
server.tool(listToolSchema.name, listToolSchema.description, {
|
|
99
|
+
per: z.number().int().min(1).max(300).optional().describe("Results per page (default: 20, max: 300)."),
|
|
100
|
+
page: z.number().int().min(1).optional().describe("Page number (default: 1)."),
|
|
101
|
+
}, (args) => handleListRemittanceRecipients(args, client));
|
|
102
|
+
server.tool(getToolSchema.name, getToolSchema.description, {
|
|
103
|
+
id: z.number().int().positive().describe("The numeric ID of the remittance recipient."),
|
|
104
|
+
}, (args) => handleGetRemittanceRecipient(args, client));
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=remittance_recipients.js.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { BudaClient } from "../client.js";
|
|
3
|
+
export declare const listRemittancesToolSchema: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
per: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
page: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const quoteRemittanceToolSchema: {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object";
|
|
25
|
+
properties: {
|
|
26
|
+
currency: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
amount: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
recipient_id: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
confirmation_token: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
required: string[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const acceptRemittanceQuoteToolSchema: {
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object";
|
|
51
|
+
properties: {
|
|
52
|
+
id: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
confirmation_token: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
required: string[];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export declare const getRemittanceToolSchema: {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: "object";
|
|
69
|
+
properties: {
|
|
70
|
+
id: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
required: string[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare function handleListRemittances(args: {
|
|
79
|
+
per?: number;
|
|
80
|
+
page?: number;
|
|
81
|
+
}, client: BudaClient): Promise<{
|
|
82
|
+
content: Array<{
|
|
83
|
+
type: "text";
|
|
84
|
+
text: string;
|
|
85
|
+
}>;
|
|
86
|
+
isError?: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
export declare function handleGetRemittance(args: {
|
|
89
|
+
id: number;
|
|
90
|
+
}, client: BudaClient): Promise<{
|
|
91
|
+
content: Array<{
|
|
92
|
+
type: "text";
|
|
93
|
+
text: string;
|
|
94
|
+
}>;
|
|
95
|
+
isError?: boolean;
|
|
96
|
+
}>;
|
|
97
|
+
export declare function handleQuoteRemittance(args: {
|
|
98
|
+
currency: string;
|
|
99
|
+
amount: number;
|
|
100
|
+
recipient_id: number;
|
|
101
|
+
confirmation_token: string;
|
|
102
|
+
}, client: BudaClient): Promise<{
|
|
103
|
+
content: Array<{
|
|
104
|
+
type: "text";
|
|
105
|
+
text: string;
|
|
106
|
+
}>;
|
|
107
|
+
isError?: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
export declare function handleAcceptRemittanceQuote(args: {
|
|
110
|
+
id: number;
|
|
111
|
+
confirmation_token: string;
|
|
112
|
+
}, client: BudaClient): Promise<{
|
|
113
|
+
content: Array<{
|
|
114
|
+
type: "text";
|
|
115
|
+
text: string;
|
|
116
|
+
}>;
|
|
117
|
+
isError?: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
export declare function register(server: McpServer, client: BudaClient): void;
|
|
120
|
+
//# sourceMappingURL=remittances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remittances.d.ts","sourceRoot":"","sources":["../../src/tools/remittances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAgB,MAAM,cAAc,CAAC;AAKxD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;CAoBrC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;CAiCrC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;CAuB3C,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;CAiBnC,CAAC;AAgBF,wBAAsB,qBAAqB,CACzC,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAoChF;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACpB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAgBhF;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,EAC5F,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAkDhF;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,EAChD,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAqChF;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CA2CpE"}
|