@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.
Files changed (199) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -0
  3. package/dist/bexio-client.d.ts +350 -0
  4. package/dist/bexio-client.js +1045 -0
  5. package/dist/index.d.ts +15 -0
  6. package/dist/index.js +80 -0
  7. package/dist/logger.d.ts +17 -0
  8. package/dist/logger.js +28 -0
  9. package/dist/server.d.ts +18 -0
  10. package/dist/server.js +81 -0
  11. package/dist/shared/errors.d.ts +21 -0
  12. package/dist/shared/errors.js +54 -0
  13. package/dist/shared/index.d.ts +5 -0
  14. package/dist/shared/index.js +5 -0
  15. package/dist/shared/response.d.ts +24 -0
  16. package/dist/shared/response.js +92 -0
  17. package/dist/tools/accounting/definitions.d.ts +9 -0
  18. package/dist/tools/accounting/definitions.js +345 -0
  19. package/dist/tools/accounting/handlers.d.ts +10 -0
  20. package/dist/tools/accounting/handlers.js +121 -0
  21. package/dist/tools/accounting/index.d.ts +16 -0
  22. package/dist/tools/accounting/index.js +16 -0
  23. package/dist/tools/banking/definitions.d.ts +11 -0
  24. package/dist/tools/banking/definitions.js +349 -0
  25. package/dist/tools/banking/handlers.d.ts +9 -0
  26. package/dist/tools/banking/handlers.js +123 -0
  27. package/dist/tools/banking/index.d.ts +6 -0
  28. package/dist/tools/banking/index.js +6 -0
  29. package/dist/tools/company/definitions.d.ts +7 -0
  30. package/dist/tools/company/definitions.js +87 -0
  31. package/dist/tools/company/handlers.d.ts +7 -0
  32. package/dist/tools/company/handlers.js +31 -0
  33. package/dist/tools/company/index.d.ts +6 -0
  34. package/dist/tools/company/index.js +6 -0
  35. package/dist/tools/contacts/definitions.d.ts +6 -0
  36. package/dist/tools/contacts/definitions.js +150 -0
  37. package/dist/tools/contacts/handlers.d.ts +7 -0
  38. package/dist/tools/contacts/handlers.js +40 -0
  39. package/dist/tools/contacts/index.d.ts +6 -0
  40. package/dist/tools/contacts/index.js +5 -0
  41. package/dist/tools/deliveries/definitions.d.ts +6 -0
  42. package/dist/tools/deliveries/definitions.js +67 -0
  43. package/dist/tools/deliveries/handlers.d.ts +7 -0
  44. package/dist/tools/deliveries/handlers.js +28 -0
  45. package/dist/tools/deliveries/index.d.ts +6 -0
  46. package/dist/tools/deliveries/index.js +5 -0
  47. package/dist/tools/files/definitions.d.ts +6 -0
  48. package/dist/tools/files/definitions.js +217 -0
  49. package/dist/tools/files/handlers.d.ts +7 -0
  50. package/dist/tools/files/handlers.js +63 -0
  51. package/dist/tools/files/index.d.ts +6 -0
  52. package/dist/tools/files/index.js +5 -0
  53. package/dist/tools/index.d.ts +19 -0
  54. package/dist/tools/index.js +93 -0
  55. package/dist/tools/invoices/definitions.d.ts +6 -0
  56. package/dist/tools/invoices/definitions.js +147 -0
  57. package/dist/tools/invoices/handlers.d.ts +7 -0
  58. package/dist/tools/invoices/handlers.js +119 -0
  59. package/dist/tools/invoices/index.d.ts +6 -0
  60. package/dist/tools/invoices/index.js +5 -0
  61. package/dist/tools/items/definitions.d.ts +6 -0
  62. package/dist/tools/items/definitions.js +100 -0
  63. package/dist/tools/items/handlers.d.ts +7 -0
  64. package/dist/tools/items/handlers.js +36 -0
  65. package/dist/tools/items/index.d.ts +6 -0
  66. package/dist/tools/items/index.js +5 -0
  67. package/dist/tools/misc/definitions.d.ts +6 -0
  68. package/dist/tools/misc/definitions.js +126 -0
  69. package/dist/tools/misc/handlers.d.ts +7 -0
  70. package/dist/tools/misc/handlers.js +52 -0
  71. package/dist/tools/misc/index.d.ts +6 -0
  72. package/dist/tools/misc/index.js +5 -0
  73. package/dist/tools/orders/definitions.d.ts +6 -0
  74. package/dist/tools/orders/definitions.js +114 -0
  75. package/dist/tools/orders/handlers.d.ts +7 -0
  76. package/dist/tools/orders/handlers.js +62 -0
  77. package/dist/tools/orders/index.d.ts +6 -0
  78. package/dist/tools/orders/index.js +5 -0
  79. package/dist/tools/payments/definitions.d.ts +6 -0
  80. package/dist/tools/payments/definitions.js +74 -0
  81. package/dist/tools/payments/handlers.d.ts +7 -0
  82. package/dist/tools/payments/handlers.js +28 -0
  83. package/dist/tools/payments/index.d.ts +6 -0
  84. package/dist/tools/payments/index.js +5 -0
  85. package/dist/tools/payroll/definitions.d.ts +15 -0
  86. package/dist/tools/payroll/definitions.js +239 -0
  87. package/dist/tools/payroll/handlers.d.ts +14 -0
  88. package/dist/tools/payroll/handlers.js +152 -0
  89. package/dist/tools/payroll/index.d.ts +16 -0
  90. package/dist/tools/payroll/index.js +16 -0
  91. package/dist/tools/projects/definitions.d.ts +7 -0
  92. package/dist/tools/projects/definitions.js +430 -0
  93. package/dist/tools/projects/handlers.d.ts +7 -0
  94. package/dist/tools/projects/handlers.js +127 -0
  95. package/dist/tools/projects/index.d.ts +6 -0
  96. package/dist/tools/projects/index.js +6 -0
  97. package/dist/tools/purchase/definitions.d.ts +6 -0
  98. package/dist/tools/purchase/definitions.js +381 -0
  99. package/dist/tools/purchase/handlers.d.ts +7 -0
  100. package/dist/tools/purchase/handlers.js +120 -0
  101. package/dist/tools/purchase/index.d.ts +7 -0
  102. package/dist/tools/purchase/index.js +6 -0
  103. package/dist/tools/quotes/definitions.d.ts +6 -0
  104. package/dist/tools/quotes/definitions.js +174 -0
  105. package/dist/tools/quotes/handlers.d.ts +7 -0
  106. package/dist/tools/quotes/handlers.js +79 -0
  107. package/dist/tools/quotes/index.d.ts +6 -0
  108. package/dist/tools/quotes/index.js +5 -0
  109. package/dist/tools/reference/definitions.d.ts +7 -0
  110. package/dist/tools/reference/definitions.js +421 -0
  111. package/dist/tools/reference/handlers.d.ts +7 -0
  112. package/dist/tools/reference/handlers.js +161 -0
  113. package/dist/tools/reference/index.d.ts +6 -0
  114. package/dist/tools/reference/index.js +6 -0
  115. package/dist/tools/reminders/definitions.d.ts +6 -0
  116. package/dist/tools/reminders/definitions.js +132 -0
  117. package/dist/tools/reminders/handlers.d.ts +7 -0
  118. package/dist/tools/reminders/handlers.js +43 -0
  119. package/dist/tools/reminders/index.d.ts +6 -0
  120. package/dist/tools/reminders/index.js +5 -0
  121. package/dist/tools/reports/definitions.d.ts +6 -0
  122. package/dist/tools/reports/definitions.js +133 -0
  123. package/dist/tools/reports/handlers.d.ts +7 -0
  124. package/dist/tools/reports/handlers.js +33 -0
  125. package/dist/tools/reports/index.d.ts +6 -0
  126. package/dist/tools/reports/index.js +5 -0
  127. package/dist/tools/timetracking/definitions.d.ts +9 -0
  128. package/dist/tools/timetracking/definitions.js +226 -0
  129. package/dist/tools/timetracking/handlers.d.ts +9 -0
  130. package/dist/tools/timetracking/handlers.js +88 -0
  131. package/dist/tools/timetracking/index.d.ts +6 -0
  132. package/dist/tools/timetracking/index.js +6 -0
  133. package/dist/tools/users/definitions.d.ts +6 -0
  134. package/dist/tools/users/definitions.js +93 -0
  135. package/dist/tools/users/handlers.d.ts +7 -0
  136. package/dist/tools/users/handlers.js +35 -0
  137. package/dist/tools/users/index.d.ts +6 -0
  138. package/dist/tools/users/index.js +5 -0
  139. package/dist/transports/http.d.ts +17 -0
  140. package/dist/transports/http.js +203 -0
  141. package/dist/transports/index.d.ts +4 -0
  142. package/dist/transports/index.js +4 -0
  143. package/dist/types/common.d.ts +32 -0
  144. package/dist/types/common.js +11 -0
  145. package/dist/types/index.d.ts +9 -0
  146. package/dist/types/index.js +11 -0
  147. package/dist/types/schemas/accounting.d.ts +225 -0
  148. package/dist/types/schemas/accounting.js +96 -0
  149. package/dist/types/schemas/banking.d.ts +207 -0
  150. package/dist/types/schemas/banking.js +86 -0
  151. package/dist/types/schemas/company.d.ts +44 -0
  152. package/dist/types/schemas/company.js +23 -0
  153. package/dist/types/schemas/contacts.d.ts +104 -0
  154. package/dist/types/schemas/contacts.js +42 -0
  155. package/dist/types/schemas/deliveries.d.ts +40 -0
  156. package/dist/types/schemas/deliveries.js +22 -0
  157. package/dist/types/schemas/files.d.ts +152 -0
  158. package/dist/types/schemas/files.js +64 -0
  159. package/dist/types/schemas/index.d.ts +24 -0
  160. package/dist/types/schemas/index.js +44 -0
  161. package/dist/types/schemas/invoices.d.ts +594 -0
  162. package/dist/types/schemas/invoices.js +109 -0
  163. package/dist/types/schemas/items.d.ts +153 -0
  164. package/dist/types/schemas/items.js +43 -0
  165. package/dist/types/schemas/misc.d.ts +64 -0
  166. package/dist/types/schemas/misc.js +36 -0
  167. package/dist/types/schemas/orders.d.ts +657 -0
  168. package/dist/types/schemas/orders.js +101 -0
  169. package/dist/types/schemas/payments.d.ts +46 -0
  170. package/dist/types/schemas/payments.js +24 -0
  171. package/dist/types/schemas/payroll.d.ts +146 -0
  172. package/dist/types/schemas/payroll.js +65 -0
  173. package/dist/types/schemas/projects.d.ts +268 -0
  174. package/dist/types/schemas/projects.js +102 -0
  175. package/dist/types/schemas/purchase.d.ts +228 -0
  176. package/dist/types/schemas/purchase.js +114 -0
  177. package/dist/types/schemas/quotes.d.ts +102 -0
  178. package/dist/types/schemas/quotes.js +49 -0
  179. package/dist/types/schemas/reference.d.ts +240 -0
  180. package/dist/types/schemas/reference.js +99 -0
  181. package/dist/types/schemas/reminders.d.ts +76 -0
  182. package/dist/types/schemas/reminders.js +38 -0
  183. package/dist/types/schemas/reports.d.ts +69 -0
  184. package/dist/types/schemas/reports.js +36 -0
  185. package/dist/types/schemas/timetracking.d.ts +150 -0
  186. package/dist/types/schemas/timetracking.js +68 -0
  187. package/dist/types/schemas/users.d.ts +51 -0
  188. package/dist/types/schemas/users.js +27 -0
  189. package/dist/ui/contact-card/mcp-app.d.ts +1 -0
  190. package/dist/ui/contact-card/mcp-app.js +108 -0
  191. package/dist/ui/dashboard/mcp-app.d.ts +1 -0
  192. package/dist/ui/dashboard/mcp-app.js +81 -0
  193. package/dist/ui/invoice-preview/mcp-app.d.ts +1 -0
  194. package/dist/ui/invoice-preview/mcp-app.js +96 -0
  195. package/dist/ui-resources.d.ts +17 -0
  196. package/dist/ui-resources.js +124 -0
  197. package/dist/vite.config.d.ts +2 -0
  198. package/dist/vite.config.js +46 -0
  199. package/package.json +78 -0
@@ -0,0 +1,345 @@
1
+ /**
2
+ * Accounting tool definitions.
3
+ * Contains MCP tool metadata for accounting domain.
4
+ * Includes: Accounts, Account Groups, Calendar Years, Business Years, Manual Entries, VAT Periods, Journal
5
+ *
6
+ * 15 tools total covering ACCT-01 through ACCT-07 requirements.
7
+ */
8
+ export const toolDefinitions = [
9
+ // ===== ACCOUNTS - Chart of Accounts (ACCT-01) =====
10
+ {
11
+ name: "list_accounts",
12
+ description: "List chart of accounts with pagination. Returns all accounts in the chart of accounts.",
13
+ inputSchema: {
14
+ type: "object",
15
+ properties: {
16
+ limit: {
17
+ type: "integer",
18
+ description: "Maximum number of results to return (default: 100)",
19
+ default: 100,
20
+ },
21
+ offset: {
22
+ type: "integer",
23
+ description: "Number of results to skip (default: 0)",
24
+ default: 0,
25
+ },
26
+ },
27
+ },
28
+ },
29
+ {
30
+ name: "get_account",
31
+ description: "Get a specific account by ID from the chart of accounts",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ account_id: {
36
+ type: "integer",
37
+ description: "The ID of the account to retrieve",
38
+ },
39
+ },
40
+ required: ["account_id"],
41
+ },
42
+ },
43
+ {
44
+ name: "create_account",
45
+ description: "Create a new account in the chart of accounts",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {
49
+ account_no: {
50
+ type: "integer",
51
+ description: "The account number (must be unique and positive)",
52
+ },
53
+ name: {
54
+ type: "string",
55
+ description: "The name of the account",
56
+ },
57
+ account_group_id: {
58
+ type: "integer",
59
+ description: "The ID of the account group this account belongs to",
60
+ },
61
+ is_active: {
62
+ type: "boolean",
63
+ description: "Whether the account is active (default: true)",
64
+ default: true,
65
+ },
66
+ tax_id: {
67
+ type: "integer",
68
+ description: "Optional tax ID to associate with this account",
69
+ },
70
+ },
71
+ required: ["account_no", "name", "account_group_id"],
72
+ },
73
+ },
74
+ {
75
+ name: "search_accounts",
76
+ description: "Search accounts by criteria. Use field/value/criteria pattern for flexible searching.",
77
+ inputSchema: {
78
+ type: "object",
79
+ properties: {
80
+ search_criteria: {
81
+ type: "array",
82
+ description: "Array of search criteria objects",
83
+ items: {
84
+ type: "object",
85
+ properties: {
86
+ field: {
87
+ type: "string",
88
+ description: "Field to search (e.g., 'name', 'account_no')",
89
+ },
90
+ value: {
91
+ type: ["string", "number", "boolean"],
92
+ description: "Value to search for",
93
+ },
94
+ criteria: {
95
+ type: "string",
96
+ description: "Search operator (e.g., '=', 'like', '>')",
97
+ },
98
+ },
99
+ required: ["field", "value"],
100
+ },
101
+ },
102
+ },
103
+ required: ["search_criteria"],
104
+ },
105
+ },
106
+ // ===== ACCOUNT GROUPS (ACCT-02) =====
107
+ {
108
+ name: "list_account_groups",
109
+ description: "List account groups (read-only hierarchy). Account groups organize the chart of accounts into categories.",
110
+ inputSchema: {
111
+ type: "object",
112
+ properties: {
113
+ limit: {
114
+ type: "integer",
115
+ description: "Maximum number of results to return (default: 100)",
116
+ default: 100,
117
+ },
118
+ offset: {
119
+ type: "integer",
120
+ description: "Number of results to skip (default: 0)",
121
+ default: 0,
122
+ },
123
+ },
124
+ },
125
+ },
126
+ // ===== CALENDAR YEARS (ACCT-03) =====
127
+ {
128
+ name: "list_calendar_years",
129
+ description: "List calendar years defined in the system",
130
+ inputSchema: {
131
+ type: "object",
132
+ properties: {
133
+ limit: {
134
+ type: "integer",
135
+ description: "Maximum number of results to return (default: 100)",
136
+ default: 100,
137
+ },
138
+ offset: {
139
+ type: "integer",
140
+ description: "Number of results to skip (default: 0)",
141
+ default: 0,
142
+ },
143
+ },
144
+ },
145
+ },
146
+ {
147
+ name: "get_calendar_year",
148
+ description: "Get a specific calendar year by ID",
149
+ inputSchema: {
150
+ type: "object",
151
+ properties: {
152
+ year_id: {
153
+ type: "integer",
154
+ description: "The ID of the calendar year to retrieve",
155
+ },
156
+ },
157
+ required: ["year_id"],
158
+ },
159
+ },
160
+ // ===== BUSINESS YEARS (ACCT-04) =====
161
+ {
162
+ name: "list_business_years",
163
+ description: "List business/fiscal years (read-only). Business years define fiscal periods for accounting.",
164
+ inputSchema: {
165
+ type: "object",
166
+ properties: {
167
+ limit: {
168
+ type: "integer",
169
+ description: "Maximum number of results to return (default: 100)",
170
+ default: 100,
171
+ },
172
+ offset: {
173
+ type: "integer",
174
+ description: "Number of results to skip (default: 0)",
175
+ default: 0,
176
+ },
177
+ },
178
+ },
179
+ },
180
+ // ===== MANUAL ENTRIES (ACCT-05) =====
181
+ {
182
+ name: "list_manual_entries",
183
+ description: "List manual journal entries",
184
+ inputSchema: {
185
+ type: "object",
186
+ properties: {
187
+ limit: {
188
+ type: "integer",
189
+ description: "Maximum number of results to return (default: 100)",
190
+ default: 100,
191
+ },
192
+ offset: {
193
+ type: "integer",
194
+ description: "Number of results to skip (default: 0)",
195
+ default: 0,
196
+ },
197
+ },
198
+ },
199
+ },
200
+ {
201
+ name: "get_manual_entry",
202
+ description: "Get a specific manual entry by ID",
203
+ inputSchema: {
204
+ type: "object",
205
+ properties: {
206
+ entry_id: {
207
+ type: "integer",
208
+ description: "The ID of the manual entry to retrieve",
209
+ },
210
+ },
211
+ required: ["entry_id"],
212
+ },
213
+ },
214
+ {
215
+ name: "create_manual_entry",
216
+ description: "Create a manual journal entry (double-entry bookkeeping). Provide flat params; the handler transforms to nested entries array internally. Bexio validates that debits equal credits.",
217
+ inputSchema: {
218
+ type: "object",
219
+ properties: {
220
+ date: {
221
+ type: "string",
222
+ description: "Entry date in YYYY-MM-DD format",
223
+ },
224
+ debit_account_id: {
225
+ type: "integer",
226
+ description: "The account ID to debit",
227
+ },
228
+ credit_account_id: {
229
+ type: "integer",
230
+ description: "The account ID to credit",
231
+ },
232
+ amount: {
233
+ type: "number",
234
+ description: "The amount for the entry (must be positive)",
235
+ },
236
+ description: {
237
+ type: "string",
238
+ description: "Description of the journal entry",
239
+ },
240
+ reference_nr: {
241
+ type: "string",
242
+ description: "Optional reference number for the entry",
243
+ },
244
+ tax_id: {
245
+ type: "integer",
246
+ description: "Optional tax ID to apply",
247
+ },
248
+ tax_account_id: {
249
+ type: "integer",
250
+ description: "Optional tax account ID",
251
+ },
252
+ currency_id: {
253
+ type: "integer",
254
+ description: "Optional currency ID (defaults to company currency)",
255
+ },
256
+ currency_factor: {
257
+ type: "number",
258
+ description: "Optional currency exchange factor (default: 1)",
259
+ default: 1,
260
+ },
261
+ },
262
+ required: ["date", "debit_account_id", "credit_account_id", "amount", "description"],
263
+ },
264
+ },
265
+ {
266
+ name: "update_manual_entry",
267
+ description: "Update a manual entry",
268
+ inputSchema: {
269
+ type: "object",
270
+ properties: {
271
+ entry_id: {
272
+ type: "integer",
273
+ description: "The ID of the manual entry to update",
274
+ },
275
+ entry_data: {
276
+ type: "object",
277
+ description: "The data to update on the manual entry",
278
+ },
279
+ },
280
+ required: ["entry_id", "entry_data"],
281
+ },
282
+ },
283
+ {
284
+ name: "delete_manual_entry",
285
+ description: "Delete a manual entry",
286
+ inputSchema: {
287
+ type: "object",
288
+ properties: {
289
+ entry_id: {
290
+ type: "integer",
291
+ description: "The ID of the manual entry to delete",
292
+ },
293
+ },
294
+ required: ["entry_id"],
295
+ },
296
+ },
297
+ // ===== VAT PERIODS (ACCT-06) =====
298
+ {
299
+ name: "list_vat_periods",
300
+ description: "List VAT periods (read-only). VAT periods define reporting periods for value-added tax.",
301
+ inputSchema: {
302
+ type: "object",
303
+ properties: {
304
+ limit: {
305
+ type: "integer",
306
+ description: "Maximum number of results to return (default: 100)",
307
+ default: 100,
308
+ },
309
+ offset: {
310
+ type: "integer",
311
+ description: "Number of results to skip (default: 0)",
312
+ default: 0,
313
+ },
314
+ },
315
+ },
316
+ },
317
+ // ===== ACCOUNTING JOURNAL (ACCT-07) =====
318
+ {
319
+ name: "get_journal",
320
+ description: "Query the accounting journal with optional date range. Returns journal entries for the specified period.",
321
+ inputSchema: {
322
+ type: "object",
323
+ properties: {
324
+ start_date: {
325
+ type: "string",
326
+ description: "Start date filter in YYYY-MM-DD format",
327
+ },
328
+ end_date: {
329
+ type: "string",
330
+ description: "End date filter in YYYY-MM-DD format",
331
+ },
332
+ limit: {
333
+ type: "integer",
334
+ description: "Maximum number of results to return (default: 100)",
335
+ default: 100,
336
+ },
337
+ offset: {
338
+ type: "integer",
339
+ description: "Number of results to skip (default: 0)",
340
+ default: 0,
341
+ },
342
+ },
343
+ },
344
+ },
345
+ ];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Accounting tool handlers.
3
+ * Implements the logic for each accounting tool.
4
+ *
5
+ * IMPORTANT: create_manual_entry transforms flat MCP params to nested Bexio API structure.
6
+ * Bexio validates double-entry rules server-side (debits must equal credits).
7
+ */
8
+ import { BexioClient } from "../../bexio-client.js";
9
+ export type HandlerFn = (client: BexioClient, args: unknown) => Promise<unknown>;
10
+ export declare const handlers: Record<string, HandlerFn>;
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Accounting tool handlers.
3
+ * Implements the logic for each accounting tool.
4
+ *
5
+ * IMPORTANT: create_manual_entry transforms flat MCP params to nested Bexio API structure.
6
+ * Bexio validates double-entry rules server-side (debits must equal credits).
7
+ */
8
+ import { McpError } from "../../shared/errors.js";
9
+ import {
10
+ // Accounts
11
+ ListAccountsParamsSchema, GetAccountParamsSchema, CreateAccountParamsSchema, SearchAccountsParamsSchema,
12
+ // Account Groups
13
+ ListAccountGroupsParamsSchema,
14
+ // Calendar Years
15
+ ListCalendarYearsParamsSchema, GetCalendarYearParamsSchema,
16
+ // Business Years
17
+ ListBusinessYearsParamsSchema,
18
+ // Manual Entries
19
+ ListManualEntriesParamsSchema, GetManualEntryParamsSchema, CreateManualEntryParamsSchema, UpdateManualEntryParamsSchema, DeleteManualEntryParamsSchema,
20
+ // VAT Periods
21
+ ListVatPeriodsParamsSchema,
22
+ // Journal
23
+ GetJournalParamsSchema, } from "../../types/index.js";
24
+ export const handlers = {
25
+ // ===== ACCOUNTS - Chart of Accounts (ACCT-01) =====
26
+ list_accounts: async (client, args) => {
27
+ const params = ListAccountsParamsSchema.parse(args);
28
+ return client.listAccounts(params);
29
+ },
30
+ get_account: async (client, args) => {
31
+ const { account_id } = GetAccountParamsSchema.parse(args);
32
+ const account = await client.getAccount(account_id);
33
+ if (!account) {
34
+ throw McpError.notFound("Account", account_id);
35
+ }
36
+ return account;
37
+ },
38
+ create_account: async (client, args) => {
39
+ const params = CreateAccountParamsSchema.parse(args);
40
+ return client.createAccount(params);
41
+ },
42
+ search_accounts: async (client, args) => {
43
+ const { search_criteria } = SearchAccountsParamsSchema.parse(args);
44
+ return client.searchAccounts(search_criteria);
45
+ },
46
+ // ===== ACCOUNT GROUPS (ACCT-02) =====
47
+ list_account_groups: async (client, args) => {
48
+ const params = ListAccountGroupsParamsSchema.parse(args);
49
+ return client.listAccountGroups(params);
50
+ },
51
+ // ===== CALENDAR YEARS (ACCT-03) =====
52
+ list_calendar_years: async (client, args) => {
53
+ const params = ListCalendarYearsParamsSchema.parse(args);
54
+ return client.listCalendarYears(params);
55
+ },
56
+ get_calendar_year: async (client, args) => {
57
+ const { year_id } = GetCalendarYearParamsSchema.parse(args);
58
+ const year = await client.getCalendarYear(year_id);
59
+ if (!year) {
60
+ throw McpError.notFound("Calendar Year", year_id);
61
+ }
62
+ return year;
63
+ },
64
+ // ===== BUSINESS YEARS (ACCT-04) =====
65
+ list_business_years: async (client, args) => {
66
+ const params = ListBusinessYearsParamsSchema.parse(args);
67
+ return client.listBusinessYears(params);
68
+ },
69
+ // ===== MANUAL ENTRIES (ACCT-05) =====
70
+ list_manual_entries: async (client, args) => {
71
+ const params = ListManualEntriesParamsSchema.parse(args);
72
+ return client.listManualEntries(params);
73
+ },
74
+ get_manual_entry: async (client, args) => {
75
+ const { entry_id } = GetManualEntryParamsSchema.parse(args);
76
+ const entry = await client.getManualEntry(entry_id);
77
+ if (!entry) {
78
+ throw McpError.notFound("Manual Entry", entry_id);
79
+ }
80
+ return entry;
81
+ },
82
+ create_manual_entry: async (client, args) => {
83
+ const params = CreateManualEntryParamsSchema.parse(args);
84
+ // Transform flat MCP params to Bexio API nested structure
85
+ // Bexio expects an entries array even for single-entry bookings
86
+ const entryData = {
87
+ type: params.type || "manual_single_entry",
88
+ date: params.date,
89
+ reference_nr: params.reference_nr,
90
+ entries: [{
91
+ debit_account_id: params.debit_account_id,
92
+ credit_account_id: params.credit_account_id,
93
+ tax_id: params.tax_id,
94
+ tax_account_id: params.tax_account_id,
95
+ description: params.description,
96
+ amount: params.amount,
97
+ currency_id: params.currency_id,
98
+ currency_factor: params.currency_factor,
99
+ }],
100
+ };
101
+ return client.createManualEntry(entryData);
102
+ },
103
+ update_manual_entry: async (client, args) => {
104
+ const { entry_id, entry_data } = UpdateManualEntryParamsSchema.parse(args);
105
+ return client.updateManualEntry(entry_id, entry_data);
106
+ },
107
+ delete_manual_entry: async (client, args) => {
108
+ const { entry_id } = DeleteManualEntryParamsSchema.parse(args);
109
+ return client.deleteManualEntry(entry_id);
110
+ },
111
+ // ===== VAT PERIODS (ACCT-06) =====
112
+ list_vat_periods: async (client, args) => {
113
+ const params = ListVatPeriodsParamsSchema.parse(args);
114
+ return client.listVatPeriods(params);
115
+ },
116
+ // ===== ACCOUNTING JOURNAL (ACCT-07) =====
117
+ get_journal: async (client, args) => {
118
+ const params = GetJournalParamsSchema.parse(args);
119
+ return client.getJournal(params);
120
+ },
121
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Accounting domain module.
3
+ * Exports tool definitions and handlers for accounting operations.
4
+ *
5
+ * ACCT-01: Accounts (Chart of Accounts) - 4 tools
6
+ * ACCT-02: Account Groups - 1 tool (read-only)
7
+ * ACCT-03: Calendar Years - 2 tools
8
+ * ACCT-04: Business Years - 1 tool (read-only)
9
+ * ACCT-05: Manual Entries - 5 tools
10
+ * ACCT-06: VAT Periods - 1 tool (read-only)
11
+ * ACCT-07: Journal - 1 tool
12
+ *
13
+ * Total: 15 tools
14
+ */
15
+ export { toolDefinitions } from "./definitions.js";
16
+ export { handlers } from "./handlers.js";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Accounting domain module.
3
+ * Exports tool definitions and handlers for accounting operations.
4
+ *
5
+ * ACCT-01: Accounts (Chart of Accounts) - 4 tools
6
+ * ACCT-02: Account Groups - 1 tool (read-only)
7
+ * ACCT-03: Calendar Years - 2 tools
8
+ * ACCT-04: Business Years - 1 tool (read-only)
9
+ * ACCT-05: Manual Entries - 5 tools
10
+ * ACCT-06: VAT Periods - 1 tool (read-only)
11
+ * ACCT-07: Journal - 1 tool
12
+ *
13
+ * Total: 15 tools
14
+ */
15
+ export { toolDefinitions } from "./definitions.js";
16
+ export { handlers } from "./handlers.js";
@@ -0,0 +1,11 @@
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
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
11
+ export declare const toolDefinitions: Tool[];