@promptpartner/bexio-mcp-server 2.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 +161 -0
- package/dist/bexio-client.d.ts +350 -0
- package/dist/bexio-client.js +1045 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +80 -0
- package/dist/logger.d.ts +17 -0
- package/dist/logger.js +28 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +81 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.js +54 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/response.d.ts +24 -0
- package/dist/shared/response.js +92 -0
- package/dist/tools/accounting/definitions.d.ts +9 -0
- package/dist/tools/accounting/definitions.js +345 -0
- package/dist/tools/accounting/handlers.d.ts +10 -0
- package/dist/tools/accounting/handlers.js +121 -0
- package/dist/tools/accounting/index.d.ts +16 -0
- package/dist/tools/accounting/index.js +16 -0
- package/dist/tools/banking/definitions.d.ts +11 -0
- package/dist/tools/banking/definitions.js +349 -0
- package/dist/tools/banking/handlers.d.ts +9 -0
- package/dist/tools/banking/handlers.js +123 -0
- package/dist/tools/banking/index.d.ts +6 -0
- package/dist/tools/banking/index.js +6 -0
- package/dist/tools/company/definitions.d.ts +7 -0
- package/dist/tools/company/definitions.js +87 -0
- package/dist/tools/company/handlers.d.ts +7 -0
- package/dist/tools/company/handlers.js +31 -0
- package/dist/tools/company/index.d.ts +6 -0
- package/dist/tools/company/index.js +6 -0
- package/dist/tools/contacts/definitions.d.ts +6 -0
- package/dist/tools/contacts/definitions.js +150 -0
- package/dist/tools/contacts/handlers.d.ts +7 -0
- package/dist/tools/contacts/handlers.js +40 -0
- package/dist/tools/contacts/index.d.ts +6 -0
- package/dist/tools/contacts/index.js +5 -0
- package/dist/tools/deliveries/definitions.d.ts +6 -0
- package/dist/tools/deliveries/definitions.js +67 -0
- package/dist/tools/deliveries/handlers.d.ts +7 -0
- package/dist/tools/deliveries/handlers.js +28 -0
- package/dist/tools/deliveries/index.d.ts +6 -0
- package/dist/tools/deliveries/index.js +5 -0
- package/dist/tools/files/definitions.d.ts +6 -0
- package/dist/tools/files/definitions.js +217 -0
- package/dist/tools/files/handlers.d.ts +7 -0
- package/dist/tools/files/handlers.js +63 -0
- package/dist/tools/files/index.d.ts +6 -0
- package/dist/tools/files/index.js +5 -0
- package/dist/tools/index.d.ts +19 -0
- package/dist/tools/index.js +93 -0
- package/dist/tools/invoices/definitions.d.ts +6 -0
- package/dist/tools/invoices/definitions.js +147 -0
- package/dist/tools/invoices/handlers.d.ts +7 -0
- package/dist/tools/invoices/handlers.js +119 -0
- package/dist/tools/invoices/index.d.ts +6 -0
- package/dist/tools/invoices/index.js +5 -0
- package/dist/tools/items/definitions.d.ts +6 -0
- package/dist/tools/items/definitions.js +100 -0
- package/dist/tools/items/handlers.d.ts +7 -0
- package/dist/tools/items/handlers.js +36 -0
- package/dist/tools/items/index.d.ts +6 -0
- package/dist/tools/items/index.js +5 -0
- package/dist/tools/misc/definitions.d.ts +6 -0
- package/dist/tools/misc/definitions.js +126 -0
- package/dist/tools/misc/handlers.d.ts +7 -0
- package/dist/tools/misc/handlers.js +52 -0
- package/dist/tools/misc/index.d.ts +6 -0
- package/dist/tools/misc/index.js +5 -0
- package/dist/tools/orders/definitions.d.ts +6 -0
- package/dist/tools/orders/definitions.js +114 -0
- package/dist/tools/orders/handlers.d.ts +7 -0
- package/dist/tools/orders/handlers.js +62 -0
- package/dist/tools/orders/index.d.ts +6 -0
- package/dist/tools/orders/index.js +5 -0
- package/dist/tools/payments/definitions.d.ts +6 -0
- package/dist/tools/payments/definitions.js +74 -0
- package/dist/tools/payments/handlers.d.ts +7 -0
- package/dist/tools/payments/handlers.js +28 -0
- package/dist/tools/payments/index.d.ts +6 -0
- package/dist/tools/payments/index.js +5 -0
- package/dist/tools/payroll/definitions.d.ts +15 -0
- package/dist/tools/payroll/definitions.js +239 -0
- package/dist/tools/payroll/handlers.d.ts +14 -0
- package/dist/tools/payroll/handlers.js +152 -0
- package/dist/tools/payroll/index.d.ts +16 -0
- package/dist/tools/payroll/index.js +16 -0
- package/dist/tools/projects/definitions.d.ts +7 -0
- package/dist/tools/projects/definitions.js +430 -0
- package/dist/tools/projects/handlers.d.ts +7 -0
- package/dist/tools/projects/handlers.js +127 -0
- package/dist/tools/projects/index.d.ts +6 -0
- package/dist/tools/projects/index.js +6 -0
- package/dist/tools/purchase/definitions.d.ts +6 -0
- package/dist/tools/purchase/definitions.js +381 -0
- package/dist/tools/purchase/handlers.d.ts +7 -0
- package/dist/tools/purchase/handlers.js +120 -0
- package/dist/tools/purchase/index.d.ts +7 -0
- package/dist/tools/purchase/index.js +6 -0
- package/dist/tools/quotes/definitions.d.ts +6 -0
- package/dist/tools/quotes/definitions.js +174 -0
- package/dist/tools/quotes/handlers.d.ts +7 -0
- package/dist/tools/quotes/handlers.js +79 -0
- package/dist/tools/quotes/index.d.ts +6 -0
- package/dist/tools/quotes/index.js +5 -0
- package/dist/tools/reference/definitions.d.ts +7 -0
- package/dist/tools/reference/definitions.js +421 -0
- package/dist/tools/reference/handlers.d.ts +7 -0
- package/dist/tools/reference/handlers.js +161 -0
- package/dist/tools/reference/index.d.ts +6 -0
- package/dist/tools/reference/index.js +6 -0
- package/dist/tools/reminders/definitions.d.ts +6 -0
- package/dist/tools/reminders/definitions.js +132 -0
- package/dist/tools/reminders/handlers.d.ts +7 -0
- package/dist/tools/reminders/handlers.js +43 -0
- package/dist/tools/reminders/index.d.ts +6 -0
- package/dist/tools/reminders/index.js +5 -0
- package/dist/tools/reports/definitions.d.ts +6 -0
- package/dist/tools/reports/definitions.js +133 -0
- package/dist/tools/reports/handlers.d.ts +7 -0
- package/dist/tools/reports/handlers.js +33 -0
- package/dist/tools/reports/index.d.ts +6 -0
- package/dist/tools/reports/index.js +5 -0
- package/dist/tools/timetracking/definitions.d.ts +9 -0
- package/dist/tools/timetracking/definitions.js +226 -0
- package/dist/tools/timetracking/handlers.d.ts +9 -0
- package/dist/tools/timetracking/handlers.js +88 -0
- package/dist/tools/timetracking/index.d.ts +6 -0
- package/dist/tools/timetracking/index.js +6 -0
- package/dist/tools/users/definitions.d.ts +6 -0
- package/dist/tools/users/definitions.js +93 -0
- package/dist/tools/users/handlers.d.ts +7 -0
- package/dist/tools/users/handlers.js +35 -0
- package/dist/tools/users/index.d.ts +6 -0
- package/dist/tools/users/index.js +5 -0
- package/dist/transports/http.d.ts +17 -0
- package/dist/transports/http.js +203 -0
- package/dist/transports/index.d.ts +4 -0
- package/dist/transports/index.js +4 -0
- package/dist/types/common.d.ts +32 -0
- package/dist/types/common.js +11 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +11 -0
- package/dist/types/schemas/accounting.d.ts +225 -0
- package/dist/types/schemas/accounting.js +96 -0
- package/dist/types/schemas/banking.d.ts +207 -0
- package/dist/types/schemas/banking.js +86 -0
- package/dist/types/schemas/company.d.ts +44 -0
- package/dist/types/schemas/company.js +23 -0
- package/dist/types/schemas/contacts.d.ts +104 -0
- package/dist/types/schemas/contacts.js +42 -0
- package/dist/types/schemas/deliveries.d.ts +40 -0
- package/dist/types/schemas/deliveries.js +22 -0
- package/dist/types/schemas/files.d.ts +152 -0
- package/dist/types/schemas/files.js +64 -0
- package/dist/types/schemas/index.d.ts +24 -0
- package/dist/types/schemas/index.js +44 -0
- package/dist/types/schemas/invoices.d.ts +594 -0
- package/dist/types/schemas/invoices.js +109 -0
- package/dist/types/schemas/items.d.ts +153 -0
- package/dist/types/schemas/items.js +43 -0
- package/dist/types/schemas/misc.d.ts +64 -0
- package/dist/types/schemas/misc.js +36 -0
- package/dist/types/schemas/orders.d.ts +657 -0
- package/dist/types/schemas/orders.js +101 -0
- package/dist/types/schemas/payments.d.ts +46 -0
- package/dist/types/schemas/payments.js +24 -0
- package/dist/types/schemas/payroll.d.ts +146 -0
- package/dist/types/schemas/payroll.js +65 -0
- package/dist/types/schemas/projects.d.ts +268 -0
- package/dist/types/schemas/projects.js +102 -0
- package/dist/types/schemas/purchase.d.ts +228 -0
- package/dist/types/schemas/purchase.js +114 -0
- package/dist/types/schemas/quotes.d.ts +102 -0
- package/dist/types/schemas/quotes.js +49 -0
- package/dist/types/schemas/reference.d.ts +240 -0
- package/dist/types/schemas/reference.js +99 -0
- package/dist/types/schemas/reminders.d.ts +76 -0
- package/dist/types/schemas/reminders.js +38 -0
- package/dist/types/schemas/reports.d.ts +69 -0
- package/dist/types/schemas/reports.js +36 -0
- package/dist/types/schemas/timetracking.d.ts +150 -0
- package/dist/types/schemas/timetracking.js +68 -0
- package/dist/types/schemas/users.d.ts +51 -0
- package/dist/types/schemas/users.js +27 -0
- package/dist/ui/contact-card/mcp-app.d.ts +1 -0
- package/dist/ui/contact-card/mcp-app.js +108 -0
- package/dist/ui/dashboard/mcp-app.d.ts +1 -0
- package/dist/ui/dashboard/mcp-app.js +81 -0
- package/dist/ui/invoice-preview/mcp-app.d.ts +1 -0
- package/dist/ui/invoice-preview/mcp-app.js +96 -0
- package/dist/ui-resources.d.ts +17 -0
- package/dist/ui-resources.js +124 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/vite.config.js +46 -0
- package/package.json +78 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banking tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for banking domain.
|
|
4
|
+
*
|
|
5
|
+
* Swiss Standards:
|
|
6
|
+
* - IBAN payments: Swiss ISO 20022 payment standards
|
|
7
|
+
* - QR payments: SIX Group QR-bill specification v2.3
|
|
8
|
+
* - Addresses: Structured format only (type S) - required from Nov 2025
|
|
9
|
+
*/
|
|
10
|
+
export const toolDefinitions = [
|
|
11
|
+
// ===== BANK ACCOUNTS (Read-Only) =====
|
|
12
|
+
{
|
|
13
|
+
name: "list_bank_accounts",
|
|
14
|
+
description: "List all configured bank accounts in Bexio. Returns account details including IBAN, bank name, and currency. Use this to get valid bank_account_id values before creating payments.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
limit: {
|
|
19
|
+
type: "integer",
|
|
20
|
+
description: "Maximum number of accounts to return (default: 100)",
|
|
21
|
+
default: 100,
|
|
22
|
+
},
|
|
23
|
+
offset: {
|
|
24
|
+
type: "integer",
|
|
25
|
+
description: "Number of accounts to skip (default: 0)",
|
|
26
|
+
default: 0,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "get_bank_account",
|
|
33
|
+
description: "Get details of a specific bank account by ID",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
account_id: {
|
|
38
|
+
type: "integer",
|
|
39
|
+
description: "The ID of the bank account to retrieve",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ["account_id"],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
// ===== CURRENCIES =====
|
|
46
|
+
{
|
|
47
|
+
name: "list_currencies",
|
|
48
|
+
description: "List all currencies configured in Bexio. Returns currency codes (CHF, EUR, USD, etc.) with their rounding factors for invoicing.",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
limit: {
|
|
53
|
+
type: "integer",
|
|
54
|
+
description: "Maximum number of currencies to return (default: 100)",
|
|
55
|
+
default: 100,
|
|
56
|
+
},
|
|
57
|
+
offset: {
|
|
58
|
+
type: "integer",
|
|
59
|
+
description: "Number of currencies to skip (default: 0)",
|
|
60
|
+
default: 0,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "get_currency",
|
|
67
|
+
description: "Get details of a specific currency by ID",
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
currency_id: {
|
|
72
|
+
type: "integer",
|
|
73
|
+
description: "The ID of the currency to retrieve",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ["currency_id"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "create_currency",
|
|
81
|
+
description: "Create a new currency in Bexio. Swiss default: round_factor 0.05 (5 rappen). Common currencies: CHF, EUR, USD, GBP.",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
name: {
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "Currency code (e.g., 'CHF', 'EUR', 'USD'). Max 10 characters.",
|
|
88
|
+
},
|
|
89
|
+
round_factor: {
|
|
90
|
+
type: "number",
|
|
91
|
+
description: "Rounding factor for amounts (default: 0.05 for Swiss 5 rappen)",
|
|
92
|
+
default: 0.05,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ["name"],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "update_currency",
|
|
100
|
+
description: "Update an existing currency's settings",
|
|
101
|
+
inputSchema: {
|
|
102
|
+
type: "object",
|
|
103
|
+
properties: {
|
|
104
|
+
currency_id: {
|
|
105
|
+
type: "integer",
|
|
106
|
+
description: "The ID of the currency to update",
|
|
107
|
+
},
|
|
108
|
+
currency_data: {
|
|
109
|
+
type: "object",
|
|
110
|
+
description: "Currency fields to update (e.g., round_factor)",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
required: ["currency_id", "currency_data"],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "delete_currency",
|
|
118
|
+
description: "Delete a currency by ID. Cannot delete currencies in use by documents.",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
currency_id: {
|
|
123
|
+
type: "integer",
|
|
124
|
+
description: "The ID of the currency to delete",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
required: ["currency_id"],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
// ===== IBAN PAYMENTS (Swiss ISO 20022) =====
|
|
131
|
+
{
|
|
132
|
+
name: "create_iban_payment",
|
|
133
|
+
description: "Create an IBAN payment (Swiss ISO 20022 standard). First use list_bank_accounts to get a valid bank_account_id. Only CHF and EUR currencies are supported. Recipient address must use structured format (street, house_number, zip, city, country_code).",
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: {
|
|
137
|
+
bank_account_id: {
|
|
138
|
+
type: "integer",
|
|
139
|
+
description: "ID of the bank account to pay from (use list_bank_accounts to find)",
|
|
140
|
+
},
|
|
141
|
+
iban: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "Recipient IBAN (15-34 characters)",
|
|
144
|
+
},
|
|
145
|
+
currency: {
|
|
146
|
+
type: "string",
|
|
147
|
+
enum: ["CHF", "EUR"],
|
|
148
|
+
description: "Payment currency (CHF or EUR only)",
|
|
149
|
+
},
|
|
150
|
+
amount: {
|
|
151
|
+
type: "number",
|
|
152
|
+
description: "Payment amount (positive number)",
|
|
153
|
+
},
|
|
154
|
+
recipient_name: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Recipient name (max 70 characters)",
|
|
157
|
+
},
|
|
158
|
+
recipient_street: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "Street name (max 70 characters, optional)",
|
|
161
|
+
},
|
|
162
|
+
recipient_house_number: {
|
|
163
|
+
type: "string",
|
|
164
|
+
description: "House/building number (max 16 characters, optional)",
|
|
165
|
+
},
|
|
166
|
+
recipient_zip: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Postal/ZIP code (max 10 characters)",
|
|
169
|
+
},
|
|
170
|
+
recipient_city: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "City name (max 35 characters)",
|
|
173
|
+
},
|
|
174
|
+
recipient_country_code: {
|
|
175
|
+
type: "string",
|
|
176
|
+
description: "ISO 3166-1 alpha-2 country code (default: CH)",
|
|
177
|
+
default: "CH",
|
|
178
|
+
},
|
|
179
|
+
execution_date: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "Payment execution date (YYYY-MM-DD format)",
|
|
182
|
+
},
|
|
183
|
+
message: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "Payment message/reference (max 140 characters, optional)",
|
|
186
|
+
},
|
|
187
|
+
is_salary_payment: {
|
|
188
|
+
type: "boolean",
|
|
189
|
+
description: "Mark as salary payment (default: false)",
|
|
190
|
+
default: false,
|
|
191
|
+
},
|
|
192
|
+
allowance_type: {
|
|
193
|
+
type: "string",
|
|
194
|
+
enum: ["no_fee", "our", "ben", "sha"],
|
|
195
|
+
description: "Fee allocation: no_fee, our (sender pays), ben (beneficiary pays), sha (shared). Default: no_fee",
|
|
196
|
+
default: "no_fee",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
required: [
|
|
200
|
+
"bank_account_id",
|
|
201
|
+
"iban",
|
|
202
|
+
"currency",
|
|
203
|
+
"amount",
|
|
204
|
+
"recipient_name",
|
|
205
|
+
"recipient_zip",
|
|
206
|
+
"recipient_city",
|
|
207
|
+
"execution_date",
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "get_iban_payment",
|
|
213
|
+
description: "Get details of an IBAN payment by ID",
|
|
214
|
+
inputSchema: {
|
|
215
|
+
type: "object",
|
|
216
|
+
properties: {
|
|
217
|
+
payment_id: {
|
|
218
|
+
type: "integer",
|
|
219
|
+
description: "The ID of the IBAN payment to retrieve",
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
required: ["payment_id"],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "update_iban_payment",
|
|
227
|
+
description: "Update a pending IBAN payment. Only pending payments can be modified.",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
payment_id: {
|
|
232
|
+
type: "integer",
|
|
233
|
+
description: "The ID of the IBAN payment to update",
|
|
234
|
+
},
|
|
235
|
+
payment_data: {
|
|
236
|
+
type: "object",
|
|
237
|
+
description: "Payment fields to update",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
required: ["payment_id", "payment_data"],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
// ===== QR PAYMENTS (Swiss QR-invoice standard) =====
|
|
244
|
+
{
|
|
245
|
+
name: "create_qr_payment",
|
|
246
|
+
description: "Create a QR payment (Swiss QR-invoice standard per SIX Group spec v2.3). First use list_bank_accounts to get a valid bank_account_id. Only CHF and EUR currencies are supported. QR reference must be exactly 27 digits if provided. Recipient address must use structured format.",
|
|
247
|
+
inputSchema: {
|
|
248
|
+
type: "object",
|
|
249
|
+
properties: {
|
|
250
|
+
bank_account_id: {
|
|
251
|
+
type: "integer",
|
|
252
|
+
description: "ID of the bank account to pay from (use list_bank_accounts to find)",
|
|
253
|
+
},
|
|
254
|
+
iban: {
|
|
255
|
+
type: "string",
|
|
256
|
+
description: "Recipient QR-IBAN (15-34 characters)",
|
|
257
|
+
},
|
|
258
|
+
currency: {
|
|
259
|
+
type: "string",
|
|
260
|
+
enum: ["CHF", "EUR"],
|
|
261
|
+
description: "Payment currency (CHF or EUR only)",
|
|
262
|
+
},
|
|
263
|
+
amount: {
|
|
264
|
+
type: "number",
|
|
265
|
+
description: "Payment amount (positive, max 999999999.99)",
|
|
266
|
+
},
|
|
267
|
+
recipient_name: {
|
|
268
|
+
type: "string",
|
|
269
|
+
description: "Recipient name (max 70 characters)",
|
|
270
|
+
},
|
|
271
|
+
recipient_street: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "Street name (max 70 characters, optional)",
|
|
274
|
+
},
|
|
275
|
+
recipient_house_number: {
|
|
276
|
+
type: "string",
|
|
277
|
+
description: "House/building number (max 16 characters, optional)",
|
|
278
|
+
},
|
|
279
|
+
recipient_zip: {
|
|
280
|
+
type: "string",
|
|
281
|
+
description: "Postal/ZIP code (max 10 characters)",
|
|
282
|
+
},
|
|
283
|
+
recipient_city: {
|
|
284
|
+
type: "string",
|
|
285
|
+
description: "City name (max 35 characters)",
|
|
286
|
+
},
|
|
287
|
+
recipient_country_code: {
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "ISO 3166-1 alpha-2 country code (default: CH)",
|
|
290
|
+
default: "CH",
|
|
291
|
+
},
|
|
292
|
+
execution_date: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "Payment execution date (YYYY-MM-DD format)",
|
|
295
|
+
},
|
|
296
|
+
qr_reference_nr: {
|
|
297
|
+
type: "string",
|
|
298
|
+
description: "QR reference number (exactly 27 digits, optional)",
|
|
299
|
+
},
|
|
300
|
+
additional_information: {
|
|
301
|
+
type: "string",
|
|
302
|
+
description: "Additional payment information (max 140 characters, optional)",
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
required: [
|
|
306
|
+
"bank_account_id",
|
|
307
|
+
"iban",
|
|
308
|
+
"currency",
|
|
309
|
+
"amount",
|
|
310
|
+
"recipient_name",
|
|
311
|
+
"recipient_zip",
|
|
312
|
+
"recipient_city",
|
|
313
|
+
"execution_date",
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "get_qr_payment",
|
|
319
|
+
description: "Get details of a QR payment by ID",
|
|
320
|
+
inputSchema: {
|
|
321
|
+
type: "object",
|
|
322
|
+
properties: {
|
|
323
|
+
payment_id: {
|
|
324
|
+
type: "integer",
|
|
325
|
+
description: "The ID of the QR payment to retrieve",
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
required: ["payment_id"],
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: "update_qr_payment",
|
|
333
|
+
description: "Update a pending QR payment. Only pending payments can be modified.",
|
|
334
|
+
inputSchema: {
|
|
335
|
+
type: "object",
|
|
336
|
+
properties: {
|
|
337
|
+
payment_id: {
|
|
338
|
+
type: "integer",
|
|
339
|
+
description: "The ID of the QR payment to update",
|
|
340
|
+
},
|
|
341
|
+
payment_data: {
|
|
342
|
+
type: "object",
|
|
343
|
+
description: "Payment fields to update",
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
required: ["payment_id", "payment_data"],
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banking tool handlers.
|
|
3
|
+
* Implements the logic for each banking tool.
|
|
4
|
+
*
|
|
5
|
+
* Payment handlers transform flat MCP params to nested Bexio API structure.
|
|
6
|
+
*/
|
|
7
|
+
import { BexioClient } from "../../bexio-client.js";
|
|
8
|
+
export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
|
|
9
|
+
export declare const handlers: Record<string, HandlerFn>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Banking tool handlers.
|
|
3
|
+
* Implements the logic for each banking tool.
|
|
4
|
+
*
|
|
5
|
+
* Payment handlers transform flat MCP params to nested Bexio API structure.
|
|
6
|
+
*/
|
|
7
|
+
import { McpError } from "../../shared/errors.js";
|
|
8
|
+
import { ListBankAccountsParamsSchema, GetBankAccountParamsSchema, ListCurrenciesParamsSchema, GetCurrencyParamsSchema, CreateCurrencyParamsSchema, UpdateCurrencyParamsSchema, DeleteCurrencyParamsSchema, CreateIbanPaymentParamsSchema, GetIbanPaymentParamsSchema, UpdateIbanPaymentParamsSchema, CreateQrPaymentParamsSchema, GetQrPaymentParamsSchema, UpdateQrPaymentParamsSchema, } from "../../types/index.js";
|
|
9
|
+
export const handlers = {
|
|
10
|
+
// ===== BANK ACCOUNTS (Read-Only) =====
|
|
11
|
+
list_bank_accounts: async (client, args) => {
|
|
12
|
+
const params = ListBankAccountsParamsSchema.parse(args);
|
|
13
|
+
return client.listBankAccounts(params);
|
|
14
|
+
},
|
|
15
|
+
get_bank_account: async (client, args) => {
|
|
16
|
+
const { account_id } = GetBankAccountParamsSchema.parse(args);
|
|
17
|
+
const account = await client.getBankAccount(account_id);
|
|
18
|
+
if (!account) {
|
|
19
|
+
throw McpError.notFound("Bank account", account_id);
|
|
20
|
+
}
|
|
21
|
+
return account;
|
|
22
|
+
},
|
|
23
|
+
// ===== CURRENCIES =====
|
|
24
|
+
list_currencies: async (client, args) => {
|
|
25
|
+
const params = ListCurrenciesParamsSchema.parse(args);
|
|
26
|
+
return client.listCurrencies(params);
|
|
27
|
+
},
|
|
28
|
+
get_currency: async (client, args) => {
|
|
29
|
+
const { currency_id } = GetCurrencyParamsSchema.parse(args);
|
|
30
|
+
const currency = await client.getCurrency(currency_id);
|
|
31
|
+
if (!currency) {
|
|
32
|
+
throw McpError.notFound("Currency", currency_id);
|
|
33
|
+
}
|
|
34
|
+
return currency;
|
|
35
|
+
},
|
|
36
|
+
create_currency: async (client, args) => {
|
|
37
|
+
const params = CreateCurrencyParamsSchema.parse(args);
|
|
38
|
+
return client.createCurrency(params);
|
|
39
|
+
},
|
|
40
|
+
update_currency: async (client, args) => {
|
|
41
|
+
const { currency_id, currency_data } = UpdateCurrencyParamsSchema.parse(args);
|
|
42
|
+
return client.updateCurrency(currency_id, currency_data);
|
|
43
|
+
},
|
|
44
|
+
delete_currency: async (client, args) => {
|
|
45
|
+
const { currency_id } = DeleteCurrencyParamsSchema.parse(args);
|
|
46
|
+
return client.deleteCurrency(currency_id);
|
|
47
|
+
},
|
|
48
|
+
// ===== IBAN PAYMENTS (Swiss ISO 20022) =====
|
|
49
|
+
create_iban_payment: async (client, args) => {
|
|
50
|
+
const params = CreateIbanPaymentParamsSchema.parse(args);
|
|
51
|
+
// Transform flat params to Bexio API nested structure
|
|
52
|
+
const paymentData = {
|
|
53
|
+
bank_account_id: params.bank_account_id,
|
|
54
|
+
iban: params.iban,
|
|
55
|
+
instructed_amount: {
|
|
56
|
+
currency: params.currency,
|
|
57
|
+
amount: params.amount,
|
|
58
|
+
},
|
|
59
|
+
recipient: {
|
|
60
|
+
name: params.recipient_name,
|
|
61
|
+
street: params.recipient_street,
|
|
62
|
+
house_number: params.recipient_house_number,
|
|
63
|
+
zip: params.recipient_zip,
|
|
64
|
+
city: params.recipient_city,
|
|
65
|
+
country_code: params.recipient_country_code,
|
|
66
|
+
},
|
|
67
|
+
execution_date: params.execution_date,
|
|
68
|
+
message: params.message,
|
|
69
|
+
is_salary_payment: params.is_salary_payment,
|
|
70
|
+
allowance_type: params.allowance_type,
|
|
71
|
+
};
|
|
72
|
+
return client.createIbanPayment(paymentData);
|
|
73
|
+
},
|
|
74
|
+
get_iban_payment: async (client, args) => {
|
|
75
|
+
const { payment_id } = GetIbanPaymentParamsSchema.parse(args);
|
|
76
|
+
const payment = await client.getIbanPayment(payment_id);
|
|
77
|
+
if (!payment) {
|
|
78
|
+
throw McpError.notFound("IBAN payment", payment_id);
|
|
79
|
+
}
|
|
80
|
+
return payment;
|
|
81
|
+
},
|
|
82
|
+
update_iban_payment: async (client, args) => {
|
|
83
|
+
const { payment_id, payment_data } = UpdateIbanPaymentParamsSchema.parse(args);
|
|
84
|
+
return client.updateIbanPayment(payment_id, payment_data);
|
|
85
|
+
},
|
|
86
|
+
// ===== QR PAYMENTS (Swiss QR-invoice standard) =====
|
|
87
|
+
create_qr_payment: async (client, args) => {
|
|
88
|
+
const params = CreateQrPaymentParamsSchema.parse(args);
|
|
89
|
+
// Transform flat params to Bexio API nested structure
|
|
90
|
+
const paymentData = {
|
|
91
|
+
bank_account_id: params.bank_account_id,
|
|
92
|
+
iban: params.iban,
|
|
93
|
+
instructed_amount: {
|
|
94
|
+
currency: params.currency,
|
|
95
|
+
amount: params.amount,
|
|
96
|
+
},
|
|
97
|
+
recipient: {
|
|
98
|
+
name: params.recipient_name,
|
|
99
|
+
street: params.recipient_street,
|
|
100
|
+
house_number: params.recipient_house_number,
|
|
101
|
+
zip: params.recipient_zip,
|
|
102
|
+
city: params.recipient_city,
|
|
103
|
+
country_code: params.recipient_country_code,
|
|
104
|
+
},
|
|
105
|
+
execution_date: params.execution_date,
|
|
106
|
+
qr_reference_nr: params.qr_reference_nr,
|
|
107
|
+
additional_information: params.additional_information,
|
|
108
|
+
};
|
|
109
|
+
return client.createQrPayment(paymentData);
|
|
110
|
+
},
|
|
111
|
+
get_qr_payment: async (client, args) => {
|
|
112
|
+
const { payment_id } = GetQrPaymentParamsSchema.parse(args);
|
|
113
|
+
const payment = await client.getQrPayment(payment_id);
|
|
114
|
+
if (!payment) {
|
|
115
|
+
throw McpError.notFound("QR payment", payment_id);
|
|
116
|
+
}
|
|
117
|
+
return payment;
|
|
118
|
+
},
|
|
119
|
+
update_qr_payment: async (client, args) => {
|
|
120
|
+
const { payment_id, payment_data } = UpdateQrPaymentParamsSchema.parse(args);
|
|
121
|
+
return client.updateQrPayment(payment_id, payment_data);
|
|
122
|
+
},
|
|
123
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company and payments config tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for company domain.
|
|
4
|
+
* Includes: Company Profile, Permissions, Payment Types
|
|
5
|
+
*/
|
|
6
|
+
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
7
|
+
export declare const toolDefinitions: Tool[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company and payments config tool definitions.
|
|
3
|
+
* Contains MCP tool metadata for company domain.
|
|
4
|
+
* Includes: Company Profile, Permissions, Payment Types
|
|
5
|
+
*/
|
|
6
|
+
export const toolDefinitions = [
|
|
7
|
+
// ===== COMPANY PROFILE (REFDATA-09) =====
|
|
8
|
+
{
|
|
9
|
+
name: "get_company_profile",
|
|
10
|
+
description: "Get the company profile including name, address, and settings",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "update_company_profile",
|
|
18
|
+
description: "Update company profile settings",
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
profile_data: {
|
|
23
|
+
type: "object",
|
|
24
|
+
description: "Profile fields to update",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
required: ["profile_data"],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
// ===== PERMISSIONS (REFDATA-10) =====
|
|
31
|
+
{
|
|
32
|
+
name: "list_permissions",
|
|
33
|
+
description: "List all available user permissions in the Bexio account",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
// ===== PAYMENT TYPES (REFDATA-08) =====
|
|
40
|
+
{
|
|
41
|
+
name: "list_payment_types",
|
|
42
|
+
description: "List all payment types available for invoices and payments",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
limit: {
|
|
47
|
+
type: "integer",
|
|
48
|
+
description: "Maximum number of results to return (default: 100)",
|
|
49
|
+
default: 100,
|
|
50
|
+
},
|
|
51
|
+
offset: {
|
|
52
|
+
type: "integer",
|
|
53
|
+
description: "Number of results to skip (default: 0)",
|
|
54
|
+
default: 0,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "get_payment_type",
|
|
61
|
+
description: "Get a specific payment type by ID",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
payment_type_id: {
|
|
66
|
+
type: "integer",
|
|
67
|
+
description: "The ID of the payment type to retrieve",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
required: ["payment_type_id"],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "create_payment_type",
|
|
75
|
+
description: "Create a new payment type for invoices and payments",
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
name: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "The name of the payment type (e.g., 'Bank Transfer', 'Cash', 'Credit Card')",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ["name"],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company and payments config tool handlers.
|
|
3
|
+
* Implements the logic for each company domain tool.
|
|
4
|
+
*/
|
|
5
|
+
import { BexioClient } from "../../bexio-client.js";
|
|
6
|
+
export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
|
|
7
|
+
export declare const handlers: Record<string, HandlerFn>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Company and payments config tool handlers.
|
|
3
|
+
* Implements the logic for each company domain tool.
|
|
4
|
+
*/
|
|
5
|
+
import { GetCompanyProfileParamsSchema, UpdateCompanyProfileParamsSchema, ListPermissionsParamsSchema, ListPaymentTypesParamsSchema, GetPaymentTypeParamsSchema, CreatePaymentTypeParamsSchema, } from "../../types/index.js";
|
|
6
|
+
export const handlers = {
|
|
7
|
+
get_company_profile: async (client, args) => {
|
|
8
|
+
GetCompanyProfileParamsSchema.parse(args);
|
|
9
|
+
return client.getCompanyProfile();
|
|
10
|
+
},
|
|
11
|
+
update_company_profile: async (client, args) => {
|
|
12
|
+
const { profile_data } = UpdateCompanyProfileParamsSchema.parse(args);
|
|
13
|
+
return client.updateCompanyProfile(profile_data);
|
|
14
|
+
},
|
|
15
|
+
list_permissions: async (client, args) => {
|
|
16
|
+
ListPermissionsParamsSchema.parse(args);
|
|
17
|
+
return client.listPermissions();
|
|
18
|
+
},
|
|
19
|
+
list_payment_types: async (client, args) => {
|
|
20
|
+
const params = ListPaymentTypesParamsSchema.parse(args);
|
|
21
|
+
return client.listPaymentTypes(params);
|
|
22
|
+
},
|
|
23
|
+
get_payment_type: async (client, args) => {
|
|
24
|
+
const { payment_type_id } = GetPaymentTypeParamsSchema.parse(args);
|
|
25
|
+
return client.getPaymentType(payment_type_id);
|
|
26
|
+
},
|
|
27
|
+
create_payment_type: async (client, args) => {
|
|
28
|
+
const { name } = CreatePaymentTypeParamsSchema.parse(args);
|
|
29
|
+
return client.createPaymentType({ name });
|
|
30
|
+
},
|
|
31
|
+
};
|