quantix-mcp 0.3.7 → 0.4.3

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 (113) hide show
  1. package/.claude/settings.local.json +2 -1
  2. package/.github/agents/copilot-instructions.md +32 -32
  3. package/.github/copilot-instructions.md +17 -17
  4. package/.github/workflows/publish.yaml +28 -28
  5. package/.opencode/command/speckit.analyze.md +184 -184
  6. package/.opencode/command/speckit.checklist.md +294 -294
  7. package/.opencode/command/speckit.clarify.md +181 -181
  8. package/.opencode/command/speckit.constitution.md +84 -84
  9. package/.opencode/command/speckit.implement.md +135 -135
  10. package/.opencode/command/speckit.plan.md +89 -89
  11. package/.opencode/command/speckit.specify.md +258 -258
  12. package/.opencode/command/speckit.tasks.md +137 -137
  13. package/.opencode/command/speckit.taskstoissues.md +30 -30
  14. package/.specify/memory/constitution.md +58 -58
  15. package/.specify/templates/constitution-template.md +50 -50
  16. package/.vscode/launch.json +14 -14
  17. package/CLAUDE.md +70 -64
  18. package/GEMINI.md +58 -0
  19. package/README.md +176 -176
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +14 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/tools/accounts.d.ts.map +1 -1
  24. package/dist/tools/accounts.js +55 -34
  25. package/dist/tools/accounts.js.map +1 -1
  26. package/dist/tools/categories.d.ts.map +1 -1
  27. package/dist/tools/categories.js +46 -20
  28. package/dist/tools/categories.js.map +1 -1
  29. package/dist/tools/credit-cards.d.ts.map +1 -1
  30. package/dist/tools/credit-cards.js +104 -33
  31. package/dist/tools/credit-cards.js.map +1 -1
  32. package/dist/tools/data.d.ts.map +1 -1
  33. package/dist/tools/data.js +19 -8
  34. package/dist/tools/data.js.map +1 -1
  35. package/dist/tools/settings.d.ts.map +1 -1
  36. package/dist/tools/settings.js +28 -12
  37. package/dist/tools/settings.js.map +1 -1
  38. package/dist/tools/subscriptions.d.ts +3 -0
  39. package/dist/tools/subscriptions.d.ts.map +1 -0
  40. package/dist/tools/subscriptions.js +128 -0
  41. package/dist/tools/subscriptions.js.map +1 -0
  42. package/dist/tools/summary.d.ts.map +1 -1
  43. package/dist/tools/summary.js +17 -11
  44. package/dist/tools/summary.js.map +1 -1
  45. package/dist/tools/transactions.d.ts.map +1 -1
  46. package/dist/tools/transactions.js +85 -50
  47. package/dist/tools/transactions.js.map +1 -1
  48. package/dist/tools/transfers.d.ts +3 -0
  49. package/dist/tools/transfers.d.ts.map +1 -0
  50. package/dist/tools/transfers.js +107 -0
  51. package/dist/tools/transfers.js.map +1 -0
  52. package/dist/types/schemas.d.ts +65 -0
  53. package/dist/types/schemas.d.ts.map +1 -1
  54. package/dist/types/schemas.js +69 -3
  55. package/dist/types/schemas.js.map +1 -1
  56. package/dist/utils/toolHelpers.d.ts +7 -0
  57. package/dist/utils/toolHelpers.d.ts.map +1 -0
  58. package/dist/utils/toolHelpers.js +11 -0
  59. package/dist/utils/toolHelpers.js.map +1 -0
  60. package/openapi.yaml +2279 -1828
  61. package/package.json +41 -41
  62. package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
  63. package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
  64. package/specs/001-mcp-api-integration/data-model.md +106 -106
  65. package/specs/001-mcp-api-integration/plan.md +73 -73
  66. package/specs/001-mcp-api-integration/quickstart.md +74 -74
  67. package/specs/001-mcp-api-integration/research.md +58 -58
  68. package/specs/001-mcp-api-integration/spec.md +119 -119
  69. package/specs/001-mcp-api-integration/tasks.md +64 -64
  70. package/src/config.ts +36 -36
  71. package/src/index.ts +60 -47
  72. package/src/services/apiClient.ts +49 -49
  73. package/src/tools/accounts.ts +122 -111
  74. package/src/tools/categories.ts +102 -81
  75. package/src/tools/credit-cards.ts +203 -147
  76. package/src/tools/data.ts +45 -36
  77. package/src/tools/settings.ts +64 -51
  78. package/src/tools/subscriptions.ts +159 -0
  79. package/src/tools/summary.ts +29 -24
  80. package/src/tools/transactions.ts +156 -128
  81. package/src/tools/transfers.ts +122 -0
  82. package/src/types/schemas.ts +304 -235
  83. package/src/utils/toolHelpers.ts +11 -0
  84. package/tests/benchmark.test.d.ts +1 -1
  85. package/tests/benchmark.test.js +32 -32
  86. package/tests/benchmark.test.ts +38 -38
  87. package/tests/server.test.d.ts +1 -1
  88. package/tests/server.test.js +12 -12
  89. package/tests/server.test.ts +14 -14
  90. package/tests/setup.d.ts +3 -3
  91. package/tests/setup.js +16 -16
  92. package/tests/setup.ts +20 -20
  93. package/tests/tools/accounts.test.ts +159 -118
  94. package/tests/tools/categories.test.d.ts +1 -1
  95. package/tests/tools/categories.test.js +62 -62
  96. package/tests/tools/categories.test.ts +120 -78
  97. package/tests/tools/credit-cards.test.d.ts +1 -1
  98. package/tests/tools/credit-cards.test.js +70 -70
  99. package/tests/tools/credit-cards.test.ts +131 -89
  100. package/tests/tools/data.test.ts +100 -0
  101. package/tests/tools/settings.test.ts +116 -0
  102. package/tests/tools/subscriptions.test.ts +173 -0
  103. package/tests/tools/summary.test.d.ts +1 -1
  104. package/tests/tools/summary.test.js +35 -35
  105. package/tests/tools/summary.test.ts +63 -42
  106. package/tests/tools/transactions.test.d.ts +1 -1
  107. package/tests/tools/transactions.test.js +66 -66
  108. package/tests/tools/transactions.test.ts +133 -82
  109. package/tests/tools/transfers.test.ts +141 -0
  110. package/tsconfig.json +52 -52
  111. package/vitest.config.d.ts +2 -2
  112. package/vitest.config.js +13 -13
  113. package/vitest.config.ts +14 -14
@@ -0,0 +1,159 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateSubscriptionInput, UpdateSubscriptionInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+ import { handleToolError } from '../utils/toolHelpers.js';
6
+
7
+ export function registerSubscriptionTools(server: McpServer) {
8
+ server.registerTool(
9
+ 'create_subscription',
10
+ {
11
+ title: 'Create Subscription',
12
+ description: 'Create a new subscription (recurring payment on a credit card)',
13
+ inputSchema: CreateSubscriptionInput
14
+ },
15
+ async (args) => {
16
+ try {
17
+ const subscription = await apiClient.post('/subscriptions', args);
18
+ return {
19
+ content: [{ type: 'text', text: `Subscription created: ${JSON.stringify(subscription, null, 2)}` }]
20
+ };
21
+ } catch (error) {
22
+ return handleToolError(error);
23
+ }
24
+ }
25
+ );
26
+
27
+ server.registerTool(
28
+ 'get_subscriptions',
29
+ {
30
+ title: 'Get Subscriptions',
31
+ description: 'List all subscriptions',
32
+ inputSchema: z.object({})
33
+ },
34
+ async () => {
35
+ try {
36
+ const subscriptions = await apiClient.get('/subscriptions');
37
+ return {
38
+ content: [{ type: 'text', text: `Subscriptions: ${JSON.stringify(subscriptions, null, 2)}` }]
39
+ };
40
+ } catch (error) {
41
+ return handleToolError(error);
42
+ }
43
+ }
44
+ );
45
+
46
+ server.registerTool(
47
+ 'get_active_subscriptions',
48
+ {
49
+ title: 'Get Active Subscriptions',
50
+ description: 'List all active subscriptions',
51
+ inputSchema: z.object({})
52
+ },
53
+ async () => {
54
+ try {
55
+ const subscriptions = await apiClient.get('/subscriptions/active');
56
+ return {
57
+ content: [{ type: 'text', text: `Active subscriptions: ${JSON.stringify(subscriptions, null, 2)}` }]
58
+ };
59
+ } catch (error) {
60
+ return handleToolError(error);
61
+ }
62
+ }
63
+ );
64
+
65
+ server.registerTool(
66
+ 'get_subscription',
67
+ {
68
+ title: 'Get Subscription',
69
+ description: 'Get a subscription by ID',
70
+ inputSchema: z.object({ id: z.string() })
71
+ },
72
+ async ({ id }) => {
73
+ try {
74
+ const subscription = await apiClient.get(`/subscriptions/${id}`);
75
+ return {
76
+ content: [{ type: 'text', text: `Subscription: ${JSON.stringify(subscription, null, 2)}` }]
77
+ };
78
+ } catch (error) {
79
+ return handleToolError(error);
80
+ }
81
+ }
82
+ );
83
+
84
+ server.registerTool(
85
+ 'update_subscription',
86
+ {
87
+ title: 'Update Subscription',
88
+ description: 'Update a subscription',
89
+ inputSchema: UpdateSubscriptionInput
90
+ },
91
+ async ({ id, ...data }) => {
92
+ try {
93
+ const subscription = await apiClient.patch(`/subscriptions/${id}`, data);
94
+ return {
95
+ content: [{ type: 'text', text: `Subscription updated: ${JSON.stringify(subscription, null, 2)}` }]
96
+ };
97
+ } catch (error) {
98
+ return handleToolError(error);
99
+ }
100
+ }
101
+ );
102
+
103
+ server.registerTool(
104
+ 'deactivate_subscription',
105
+ {
106
+ title: 'Deactivate Subscription',
107
+ description: 'Deactivate a subscription (soft delete)',
108
+ inputSchema: z.object({ id: z.string() })
109
+ },
110
+ async ({ id }) => {
111
+ try {
112
+ const result = await apiClient.delete(`/subscriptions/${id}`);
113
+ return {
114
+ content: [{ type: 'text', text: `Subscription deactivated: ${JSON.stringify(result, null, 2)}` }]
115
+ };
116
+ } catch (error) {
117
+ return handleToolError(error);
118
+ }
119
+ }
120
+ );
121
+
122
+ server.registerTool(
123
+ 'delete_subscription_permanent',
124
+ {
125
+ title: 'Delete Subscription Permanently',
126
+ description: 'Permanently delete a subscription',
127
+ inputSchema: z.object({ id: z.string() })
128
+ },
129
+ async ({ id }) => {
130
+ try {
131
+ const result = await apiClient.delete(`/subscriptions/${id}/permanent`);
132
+ return {
133
+ content: [{ type: 'text', text: `Subscription permanently deleted: ${JSON.stringify(result, null, 2)}` }]
134
+ };
135
+ } catch (error) {
136
+ return handleToolError(error);
137
+ }
138
+ }
139
+ );
140
+
141
+ server.registerTool(
142
+ 'reactivate_subscription',
143
+ {
144
+ title: 'Reactivate Subscription',
145
+ description: 'Reactivate a deactivated subscription',
146
+ inputSchema: z.object({ id: z.string() })
147
+ },
148
+ async ({ id }) => {
149
+ try {
150
+ const subscription = await apiClient.patch(`/subscriptions/${id}/reactivate`, {});
151
+ return {
152
+ content: [{ type: 'text', text: `Subscription reactivated: ${JSON.stringify(subscription, null, 2)}` }]
153
+ };
154
+ } catch (error) {
155
+ return handleToolError(error);
156
+ }
157
+ }
158
+ );
159
+ }
@@ -1,24 +1,29 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { GetSummaryInput } from '../types/schemas.js';
3
- import { apiClient } from '../services/apiClient.js';
4
-
5
- export function registerSummaryTools(server: McpServer) {
6
- server.registerTool(
7
- 'get_summary',
8
- {
9
- title: 'Get Financial Summary',
10
- description: 'Get financial summary (income, expenses, balance, credit cards, category breakdowns). Provide either month (YYYY-MM) or startDate+endDate (YYYY-MM-DD).',
11
- inputSchema: GetSummaryInput
12
- },
13
- async ({ month, startDate, endDate }) => {
14
- const params = new URLSearchParams();
15
- if (month) params.append('month', month);
16
- if (startDate) params.append('startDate', startDate);
17
- if (endDate) params.append('endDate', endDate);
18
- const summary = await apiClient.get(`/summary?${params.toString()}`);
19
- return {
20
- content: [{ type: 'text', text: `Summary: ${JSON.stringify(summary, null, 2)}` }]
21
- };
22
- }
23
- );
24
- }
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { GetSummaryInput } from '../types/schemas.js';
3
+ import { apiClient } from '../services/apiClient.js';
4
+ import { handleToolError } from '../utils/toolHelpers.js';
5
+
6
+ export function registerSummaryTools(server: McpServer) {
7
+ server.registerTool(
8
+ 'get_summary',
9
+ {
10
+ title: 'Get Financial Summary',
11
+ description: 'Get financial summary (income, expenses, balance, credit cards, category breakdowns). Provide either month (YYYY-MM) or startDate+endDate (YYYY-MM-DD).',
12
+ inputSchema: GetSummaryInput
13
+ },
14
+ async ({ month, startDate, endDate }) => {
15
+ try {
16
+ const params = new URLSearchParams();
17
+ if (month) params.append('month', month);
18
+ if (startDate) params.append('startDate', startDate);
19
+ if (endDate) params.append('endDate', endDate);
20
+ const summary = await apiClient.get(`/summary?${params.toString()}`);
21
+ return {
22
+ content: [{ type: 'text', text: `Summary: ${JSON.stringify(summary, null, 2)}` }]
23
+ };
24
+ } catch (error) {
25
+ return handleToolError(error);
26
+ }
27
+ }
28
+ );
29
+ }
@@ -1,128 +1,156 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { z } from 'zod';
3
- import { CreateTransactionInput, GetTransactionsInput, UpdateTransactionInput } from '../types/schemas.js';
4
- import { apiClient } from '../services/apiClient.js';
5
-
6
- export function registerTransactionTools(server: McpServer) {
7
- server.registerTool(
8
- 'create_transaction',
9
- {
10
- title: 'Create Transaction',
11
- description: 'Record a new income or expense',
12
- inputSchema: CreateTransactionInput
13
- },
14
- async (args) => {
15
- const transaction = await apiClient.post('/transactions', args);
16
- return {
17
- content: [{ type: 'text', text: `Transaction created: ${JSON.stringify(transaction, null, 2)}` }]
18
- };
19
- }
20
- );
21
-
22
- server.registerTool(
23
- 'get_transactions',
24
- {
25
- title: 'Get Transactions',
26
- description: 'List transactions with optional filters (month, date range, account, category, credit card, type, paid status)',
27
- inputSchema: GetTransactionsInput
28
- },
29
- async (args) => {
30
- const params = new URLSearchParams();
31
- if (args.month) params.append('month', args.month);
32
- if (args.accountId) params.append('accountId', args.accountId);
33
- if (args.categoryId) params.append('categoryId', args.categoryId);
34
- if (args.creditCardId) params.append('creditCardId', args.creditCardId);
35
- if (args.type) params.append('type', args.type);
36
- if (args.startDate) params.append('startDate', args.startDate);
37
- if (args.endDate) params.append('endDate', args.endDate);
38
- if (args.paid !== undefined) params.append('paid', String(args.paid));
39
- const qs = params.toString();
40
- const url = qs ? `/transactions?${qs}` : '/transactions';
41
- const transactions = await apiClient.get(url);
42
- return {
43
- content: [{ type: 'text', text: `Transactions: ${JSON.stringify(transactions, null, 2)}` }]
44
- };
45
- }
46
- );
47
-
48
- server.registerTool(
49
- 'get_transaction',
50
- {
51
- title: 'Get Transaction',
52
- description: 'Get a transaction by ID',
53
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
54
- },
55
- async ({ id }) => {
56
- const transaction = await apiClient.get(`/transactions/${id}`);
57
- return {
58
- content: [{ type: 'text', text: `Transaction: ${JSON.stringify(transaction, null, 2)}` }]
59
- };
60
- }
61
- );
62
-
63
- server.registerTool(
64
- 'update_transaction',
65
- {
66
- title: 'Update Transaction',
67
- description: 'Update a transaction',
68
- inputSchema: UpdateTransactionInput
69
- },
70
- async ({ id, mode, ...data }) => {
71
- const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
72
- const transaction = await apiClient.patch(url, data);
73
- return {
74
- content: [{ type: 'text', text: `Transaction updated: ${JSON.stringify(transaction, null, 2)}` }]
75
- };
76
- }
77
- );
78
-
79
- server.registerTool(
80
- 'pay_transaction',
81
- {
82
- title: 'Pay Transaction',
83
- description: 'Mark a transaction as paid/received',
84
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
85
- },
86
- async ({ id }) => {
87
- // PATCH /transactions/{id}/pay
88
- await apiClient.patch(`/transactions/${id}/pay`);
89
- return {
90
- content: [{ type: 'text', text: `Transaction ${id} marked as paid.` }]
91
- };
92
- }
93
- );
94
-
95
- server.registerTool(
96
- 'unpay_transaction',
97
- {
98
- title: 'Unpay Transaction',
99
- description: 'Mark a transaction as unpaid',
100
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
101
- },
102
- async ({ id }) => {
103
- await apiClient.patch(`/transactions/${id}/unpay`);
104
- return {
105
- content: [{ type: 'text', text: `Transaction ${id} marked as unpaid.` }]
106
- };
107
- }
108
- );
109
-
110
- server.registerTool(
111
- 'delete_transaction',
112
- {
113
- title: 'Delete Transaction',
114
- description: 'Delete a transaction by ID',
115
- inputSchema: z.object({
116
- id: z.string().describe("Transaction ID"),
117
- mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional()
118
- })
119
- },
120
- async ({ id, mode }) => {
121
- const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
122
- await apiClient.delete(url);
123
- return {
124
- content: [{ type: 'text', text: `Transaction ${id} deleted.` }]
125
- };
126
- }
127
- );
128
- }
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateTransactionInput, GetTransactionsInput, UpdateTransactionInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+ import { handleToolError } from '../utils/toolHelpers.js';
6
+
7
+ export function registerTransactionTools(server: McpServer) {
8
+ server.registerTool(
9
+ 'create_transaction',
10
+ {
11
+ title: 'Create Transaction',
12
+ description: 'Record a new income or expense',
13
+ inputSchema: CreateTransactionInput
14
+ },
15
+ async (args) => {
16
+ try {
17
+ const transaction = await apiClient.post('/transactions', args);
18
+ return {
19
+ content: [{ type: 'text', text: `Transaction created: ${JSON.stringify(transaction, null, 2)}` }]
20
+ };
21
+ } catch (error) {
22
+ return handleToolError(error);
23
+ }
24
+ }
25
+ );
26
+
27
+ server.registerTool(
28
+ 'get_transactions',
29
+ {
30
+ title: 'Get Transactions',
31
+ description: 'List transactions with optional filters (month, date range, account, category, credit card, type, paid status)',
32
+ inputSchema: GetTransactionsInput
33
+ },
34
+ async (args) => {
35
+ try {
36
+ const params = new URLSearchParams();
37
+ if (args.month) params.append('month', args.month);
38
+ if (args.accountId) params.append('accountId', args.accountId);
39
+ if (args.categoryId) params.append('categoryId', args.categoryId);
40
+ if (args.creditCardId) params.append('creditCardId', args.creditCardId);
41
+ if (args.type) params.append('type', args.type);
42
+ if (args.startDate) params.append('startDate', args.startDate);
43
+ if (args.endDate) params.append('endDate', args.endDate);
44
+ if (args.paid !== undefined) params.append('paid', String(args.paid));
45
+ const qs = params.toString();
46
+ const url = qs ? `/transactions?${qs}` : '/transactions';
47
+ const transactions = await apiClient.get(url);
48
+ return {
49
+ content: [{ type: 'text', text: `Transactions: ${JSON.stringify(transactions, null, 2)}` }]
50
+ };
51
+ } catch (error) {
52
+ return handleToolError(error);
53
+ }
54
+ }
55
+ );
56
+
57
+ server.registerTool(
58
+ 'get_transaction',
59
+ {
60
+ title: 'Get Transaction',
61
+ description: 'Get a transaction by ID',
62
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
63
+ },
64
+ async ({ id }) => {
65
+ try {
66
+ const transaction = await apiClient.get(`/transactions/${id}`);
67
+ return {
68
+ content: [{ type: 'text', text: `Transaction: ${JSON.stringify(transaction, null, 2)}` }]
69
+ };
70
+ } catch (error) {
71
+ return handleToolError(error);
72
+ }
73
+ }
74
+ );
75
+
76
+ server.registerTool(
77
+ 'update_transaction',
78
+ {
79
+ title: 'Update Transaction',
80
+ description: 'Update a transaction',
81
+ inputSchema: UpdateTransactionInput
82
+ },
83
+ async ({ id, mode, ...data }) => {
84
+ try {
85
+ const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
86
+ const transaction = await apiClient.patch(url, data);
87
+ return {
88
+ content: [{ type: 'text', text: `Transaction updated: ${JSON.stringify(transaction, null, 2)}` }]
89
+ };
90
+ } catch (error) {
91
+ return handleToolError(error);
92
+ }
93
+ }
94
+ );
95
+
96
+ server.registerTool(
97
+ 'pay_transaction',
98
+ {
99
+ title: 'Pay Transaction',
100
+ description: 'Mark a transaction as paid/received',
101
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
102
+ },
103
+ async ({ id }) => {
104
+ try {
105
+ const transaction = await apiClient.patch(`/transactions/${id}/pay`);
106
+ return {
107
+ content: [{ type: 'text', text: `Transaction marked as paid: ${JSON.stringify(transaction, null, 2)}` }]
108
+ };
109
+ } catch (error) {
110
+ return handleToolError(error);
111
+ }
112
+ }
113
+ );
114
+
115
+ server.registerTool(
116
+ 'unpay_transaction',
117
+ {
118
+ title: 'Unpay Transaction',
119
+ description: 'Mark a transaction as unpaid',
120
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
121
+ },
122
+ async ({ id }) => {
123
+ try {
124
+ const transaction = await apiClient.patch(`/transactions/${id}/unpay`);
125
+ return {
126
+ content: [{ type: 'text', text: `Transaction marked as unpaid: ${JSON.stringify(transaction, null, 2)}` }]
127
+ };
128
+ } catch (error) {
129
+ return handleToolError(error);
130
+ }
131
+ }
132
+ );
133
+
134
+ server.registerTool(
135
+ 'delete_transaction',
136
+ {
137
+ title: 'Delete Transaction',
138
+ description: 'Delete a transaction by ID',
139
+ inputSchema: z.object({
140
+ id: z.string().describe("Transaction ID"),
141
+ mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional()
142
+ })
143
+ },
144
+ async ({ id, mode }) => {
145
+ try {
146
+ const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
147
+ await apiClient.delete(url);
148
+ return {
149
+ content: [{ type: 'text', text: `Transaction ${id} deleted.` }]
150
+ };
151
+ } catch (error) {
152
+ return handleToolError(error);
153
+ }
154
+ }
155
+ );
156
+ }
@@ -0,0 +1,122 @@
1
+ // MCP tools for /transfers endpoints
2
+ // Auto-generated, Feb 2026
3
+ import { z } from 'zod';
4
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
+ import { apiClient } from '../services/apiClient.js';
6
+ import { TransferSchema, CreateTransferRequestSchema, UpdateTransferRequestSchema } from '../types/schemas.js';
7
+ import { handleToolError } from '../utils/toolHelpers.js';
8
+
9
+ export function registerTransferTools(server: McpServer) {
10
+ // Create transfer
11
+ server.registerTool(
12
+ 'create_transfer',
13
+ {
14
+ title: 'Create Transfer',
15
+ description: 'Create a new transfer between accounts',
16
+ inputSchema: CreateTransferRequestSchema
17
+ },
18
+ async (input: z.infer<typeof CreateTransferRequestSchema>) => {
19
+ try {
20
+ const transfer = await apiClient.post('/transfers', input);
21
+ return {
22
+ content: [{ type: 'text', text: `Transfer created: ${JSON.stringify(transfer, null, 2)}` }]
23
+ };
24
+ } catch (error) {
25
+ return handleToolError(error);
26
+ }
27
+ }
28
+ );
29
+
30
+ // List transfers
31
+ server.registerTool(
32
+ 'get_transfers',
33
+ {
34
+ title: 'Get Transfers',
35
+ description: 'List transfers with optional filters',
36
+ inputSchema: z.object({
37
+ accountId: z.string().optional(),
38
+ month: z.string().regex(/^\d{4}-\d{2}$/).optional(),
39
+ startDate: z.string().optional(),
40
+ endDate: z.string().optional(),
41
+ })
42
+ },
43
+ async (input: { accountId?: string | undefined; month?: string | undefined; startDate?: string | undefined; endDate?: string | undefined }) => {
44
+ try {
45
+ const params = new URLSearchParams();
46
+ if (input.accountId) params.append('accountId', input.accountId);
47
+ if (input.month) params.append('month', input.month);
48
+ if (input.startDate) params.append('startDate', input.startDate);
49
+ if (input.endDate) params.append('endDate', input.endDate);
50
+ const qs = params.toString();
51
+ const url = qs ? `/transfers?${qs}` : '/transfers';
52
+ const transfers = await apiClient.get(url);
53
+ return {
54
+ content: [{ type: 'text', text: `Transfers: ${JSON.stringify(transfers, null, 2)}` }]
55
+ };
56
+ } catch (error) {
57
+ return handleToolError(error);
58
+ }
59
+ }
60
+ );
61
+
62
+ // Get transfer by ID
63
+ server.registerTool(
64
+ 'get_transfer',
65
+ {
66
+ title: 'Get Transfer',
67
+ description: 'Get a transfer by ID',
68
+ inputSchema: z.object({ id: z.string() })
69
+ },
70
+ async (input: { id: string }) => {
71
+ try {
72
+ const transfer = await apiClient.get(`/transfers/${input.id}`);
73
+ return {
74
+ content: [{ type: 'text', text: `Transfer: ${JSON.stringify(transfer, null, 2)}` }]
75
+ };
76
+ } catch (error) {
77
+ return handleToolError(error);
78
+ }
79
+ }
80
+ );
81
+
82
+ // Update transfer
83
+ server.registerTool(
84
+ 'update_transfer',
85
+ {
86
+ title: 'Update Transfer',
87
+ description: 'Update a transfer',
88
+ inputSchema: z.object({ id: z.string() }).merge(UpdateTransferRequestSchema)
89
+ },
90
+ async (input: { id: string } & z.infer<typeof UpdateTransferRequestSchema>) => {
91
+ try {
92
+ const { id, ...body } = input;
93
+ const transfer = await apiClient.patch(`/transfers/${id}`, body);
94
+ return {
95
+ content: [{ type: 'text', text: `Transfer updated: ${JSON.stringify(transfer, null, 2)}` }]
96
+ };
97
+ } catch (error) {
98
+ return handleToolError(error);
99
+ }
100
+ }
101
+ );
102
+
103
+ // Delete transfer
104
+ server.registerTool(
105
+ 'delete_transfer',
106
+ {
107
+ title: 'Delete Transfer',
108
+ description: 'Delete a transfer',
109
+ inputSchema: z.object({ id: z.string() })
110
+ },
111
+ async (input: { id: string }) => {
112
+ try {
113
+ await apiClient.delete(`/transfers/${input.id}`);
114
+ return {
115
+ content: [{ type: 'text', text: `Transfer deleted: ${input.id}` }]
116
+ };
117
+ } catch (error) {
118
+ return handleToolError(error);
119
+ }
120
+ }
121
+ );
122
+ }