quantix-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of quantix-mcp might be problematic. Click here for more details.

Files changed (148) hide show
  1. package/.github/agents/copilot-instructions.md +32 -0
  2. package/.github/agents/speckit.analyze.agent.md +184 -0
  3. package/.github/agents/speckit.checklist.agent.md +294 -0
  4. package/.github/agents/speckit.clarify.agent.md +181 -0
  5. package/.github/agents/speckit.constitution.agent.md +82 -0
  6. package/.github/agents/speckit.implement.agent.md +135 -0
  7. package/.github/agents/speckit.plan.agent.md +89 -0
  8. package/.github/agents/speckit.specify.agent.md +258 -0
  9. package/.github/agents/speckit.tasks.agent.md +137 -0
  10. package/.github/agents/speckit.taskstoissues.agent.md +30 -0
  11. package/.github/copilot-instructions.md +17 -0
  12. package/.github/prompts/speckit.analyze.prompt.md +3 -0
  13. package/.github/prompts/speckit.checklist.prompt.md +3 -0
  14. package/.github/prompts/speckit.clarify.prompt.md +3 -0
  15. package/.github/prompts/speckit.constitution.prompt.md +3 -0
  16. package/.github/prompts/speckit.implement.prompt.md +3 -0
  17. package/.github/prompts/speckit.plan.prompt.md +3 -0
  18. package/.github/prompts/speckit.specify.prompt.md +3 -0
  19. package/.github/prompts/speckit.tasks.prompt.md +3 -0
  20. package/.github/prompts/speckit.taskstoissues.prompt.md +3 -0
  21. package/.github/workflows/publish.yaml +28 -0
  22. package/.opencode/command/speckit.analyze.md +184 -0
  23. package/.opencode/command/speckit.checklist.md +294 -0
  24. package/.opencode/command/speckit.clarify.md +181 -0
  25. package/.opencode/command/speckit.constitution.md +84 -0
  26. package/.opencode/command/speckit.implement.md +135 -0
  27. package/.opencode/command/speckit.plan.md +89 -0
  28. package/.opencode/command/speckit.specify.md +258 -0
  29. package/.opencode/command/speckit.tasks.md +137 -0
  30. package/.opencode/command/speckit.taskstoissues.md +30 -0
  31. package/.specify/memory/constitution.md +58 -0
  32. package/.specify/scripts/powershell/check-prerequisites.ps1 +148 -0
  33. package/.specify/scripts/powershell/common.ps1 +137 -0
  34. package/.specify/scripts/powershell/create-new-feature.ps1 +283 -0
  35. package/.specify/scripts/powershell/setup-plan.ps1 +61 -0
  36. package/.specify/scripts/powershell/update-agent-context.ps1 +448 -0
  37. package/.specify/templates/agent-file-template.md +28 -0
  38. package/.specify/templates/checklist-template.md +40 -0
  39. package/.specify/templates/constitution-template.md +50 -0
  40. package/.specify/templates/plan-template.md +104 -0
  41. package/.specify/templates/spec-template.md +115 -0
  42. package/.specify/templates/tasks-template.md +251 -0
  43. package/.vscode/launch.json +14 -0
  44. package/.vscode/settings.json +14 -0
  45. package/.vscode/tasks.json +15 -0
  46. package/README.md +151 -0
  47. package/dist/config.d.ts +8 -0
  48. package/dist/config.d.ts.map +1 -0
  49. package/dist/config.js +31 -0
  50. package/dist/config.js.map +1 -0
  51. package/dist/index.d.ts +6 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +48 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/services/apiClient.d.ts +14 -0
  56. package/dist/services/apiClient.d.ts.map +1 -0
  57. package/dist/services/apiClient.js +41 -0
  58. package/dist/services/apiClient.js.map +1 -0
  59. package/dist/tools/accounts.d.ts +3 -0
  60. package/dist/tools/accounts.d.ts.map +1 -0
  61. package/dist/tools/accounts.js +77 -0
  62. package/dist/tools/accounts.js.map +1 -0
  63. package/dist/tools/categories.d.ts +3 -0
  64. package/dist/tools/categories.d.ts.map +1 -0
  65. package/dist/tools/categories.js +57 -0
  66. package/dist/tools/categories.js.map +1 -0
  67. package/dist/tools/credit-cards.d.ts +3 -0
  68. package/dist/tools/credit-cards.d.ts.map +1 -0
  69. package/dist/tools/credit-cards.js +93 -0
  70. package/dist/tools/credit-cards.js.map +1 -0
  71. package/dist/tools/settings.d.ts +3 -0
  72. package/dist/tools/settings.d.ts.map +1 -0
  73. package/dist/tools/settings.js +37 -0
  74. package/dist/tools/settings.js.map +1 -0
  75. package/dist/tools/summary.d.ts +3 -0
  76. package/dist/tools/summary.d.ts.map +1 -0
  77. package/dist/tools/summary.js +16 -0
  78. package/dist/tools/summary.js.map +1 -0
  79. package/dist/tools/transactions.d.ts +3 -0
  80. package/dist/tools/transactions.d.ts.map +1 -0
  81. package/dist/tools/transactions.js +84 -0
  82. package/dist/tools/transactions.js.map +1 -0
  83. package/dist/types/schemas.d.ts +288 -0
  84. package/dist/types/schemas.d.ts.map +1 -0
  85. package/dist/types/schemas.js +170 -0
  86. package/dist/types/schemas.js.map +1 -0
  87. package/openapi.yaml +1443 -0
  88. package/package.json +41 -0
  89. package/specs/001-mcp-api-integration/checklists/requirements.md +34 -0
  90. package/specs/001-mcp-api-integration/contracts/openapi.yaml +636 -0
  91. package/specs/001-mcp-api-integration/data-model.md +106 -0
  92. package/specs/001-mcp-api-integration/plan.md +73 -0
  93. package/specs/001-mcp-api-integration/quickstart.md +74 -0
  94. package/specs/001-mcp-api-integration/research.md +58 -0
  95. package/specs/001-mcp-api-integration/spec.md +119 -0
  96. package/specs/001-mcp-api-integration/tasks.md +64 -0
  97. package/src/config.ts +36 -0
  98. package/src/index.ts +60 -0
  99. package/src/services/apiClient.ts +49 -0
  100. package/src/tools/accounts.ts +111 -0
  101. package/src/tools/categories.ts +81 -0
  102. package/src/tools/credit-cards.ts +132 -0
  103. package/src/tools/settings.ts +51 -0
  104. package/src/tools/summary.ts +20 -0
  105. package/src/tools/transactions.ts +118 -0
  106. package/src/types/schemas.ts +193 -0
  107. package/tests/benchmark.test.d.ts +2 -0
  108. package/tests/benchmark.test.d.ts.map +1 -0
  109. package/tests/benchmark.test.js +33 -0
  110. package/tests/benchmark.test.js.map +1 -0
  111. package/tests/benchmark.test.ts +38 -0
  112. package/tests/server.test.d.ts +2 -0
  113. package/tests/server.test.d.ts.map +1 -0
  114. package/tests/server.test.js +13 -0
  115. package/tests/server.test.js.map +1 -0
  116. package/tests/server.test.ts +14 -0
  117. package/tests/setup.d.ts +4 -0
  118. package/tests/setup.d.ts.map +1 -0
  119. package/tests/setup.js +17 -0
  120. package/tests/setup.js.map +1 -0
  121. package/tests/setup.ts +20 -0
  122. package/tests/tools/accounts.test.ts +118 -0
  123. package/tests/tools/categories.test.d.ts +2 -0
  124. package/tests/tools/categories.test.d.ts.map +1 -0
  125. package/tests/tools/categories.test.js +63 -0
  126. package/tests/tools/categories.test.js.map +1 -0
  127. package/tests/tools/categories.test.ts +78 -0
  128. package/tests/tools/credit-cards.test.d.ts +2 -0
  129. package/tests/tools/credit-cards.test.d.ts.map +1 -0
  130. package/tests/tools/credit-cards.test.js +71 -0
  131. package/tests/tools/credit-cards.test.js.map +1 -0
  132. package/tests/tools/credit-cards.test.ts +89 -0
  133. package/tests/tools/summary.test.d.ts +2 -0
  134. package/tests/tools/summary.test.d.ts.map +1 -0
  135. package/tests/tools/summary.test.js +36 -0
  136. package/tests/tools/summary.test.js.map +1 -0
  137. package/tests/tools/summary.test.ts +42 -0
  138. package/tests/tools/transactions.test.d.ts +2 -0
  139. package/tests/tools/transactions.test.d.ts.map +1 -0
  140. package/tests/tools/transactions.test.js +67 -0
  141. package/tests/tools/transactions.test.js.map +1 -0
  142. package/tests/tools/transactions.test.ts +82 -0
  143. package/tsconfig.json +52 -0
  144. package/vitest.config.d.ts +3 -0
  145. package/vitest.config.d.ts.map +1 -0
  146. package/vitest.config.js +14 -0
  147. package/vitest.config.js.map +1 -0
  148. package/vitest.config.ts +14 -0
@@ -0,0 +1,111 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateAccountInput, UpdateAccountInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+
6
+ export function registerAccountTools(server: McpServer) {
7
+ server.registerTool(
8
+ 'create_account',
9
+ {
10
+ title: 'Create Account',
11
+ description: 'Create a new financial account (BANK_ACCOUNT, WALLET, etc.)',
12
+ inputSchema: CreateAccountInput
13
+ },
14
+ async (args) => {
15
+ const account = await apiClient.post('/accounts', args);
16
+ return {
17
+ content: [{ type: 'text', text: `Account created: ${JSON.stringify(account, null, 2)}` }]
18
+ };
19
+ }
20
+ );
21
+
22
+ server.registerTool(
23
+ 'get_accounts',
24
+ {
25
+ title: 'Get Accounts',
26
+ description: 'List all financial accounts with current balances',
27
+ inputSchema: z.object({})
28
+ },
29
+ async () => {
30
+ const accounts = await apiClient.get('/accounts');
31
+ return {
32
+ content: [{ type: 'text', text: `Accounts: ${JSON.stringify(accounts, null, 2)}` }]
33
+ };
34
+ }
35
+ );
36
+
37
+ server.registerTool(
38
+ 'get_account',
39
+ {
40
+ title: 'Get Account Details',
41
+ description: 'Get details of a specific account by ID',
42
+ inputSchema: z.object({ id: z.string() })
43
+ },
44
+ async ({ id }) => {
45
+ const account = await apiClient.get(`/accounts/${id}`);
46
+ return {
47
+ content: [{ type: 'text', text: `Account details: ${JSON.stringify(account, null, 2)}` }]
48
+ };
49
+ }
50
+ );
51
+
52
+ server.registerTool(
53
+ 'update_account',
54
+ {
55
+ title: 'Update Account',
56
+ description: 'Update an existing account',
57
+ inputSchema: UpdateAccountInput
58
+ },
59
+ async ({ id, ...data }) => {
60
+ const account = await apiClient.patch(`/accounts/${id}`, data);
61
+ return {
62
+ content: [{ type: 'text', text: `Account updated: ${JSON.stringify(account, null, 2)}` }]
63
+ };
64
+ }
65
+ );
66
+
67
+ server.registerTool(
68
+ 'delete_account',
69
+ {
70
+ title: 'Delete Account',
71
+ description: 'Delete an account by ID',
72
+ inputSchema: z.object({ id: z.string() })
73
+ },
74
+ async ({ id }) => {
75
+ await apiClient.delete(`/accounts/${id}`);
76
+ return {
77
+ content: [{ type: 'text', text: `Account deleted successfully (ID: ${id})` }]
78
+ };
79
+ }
80
+ );
81
+
82
+ server.registerTool(
83
+ 'get_account_balance',
84
+ {
85
+ title: 'Get Account Balance',
86
+ description: 'Get the current balance for a specific account',
87
+ inputSchema: z.object({ id: z.string() })
88
+ },
89
+ async ({ id }) => {
90
+ const balance = await apiClient.get(`/accounts/${id}/balance`);
91
+ return {
92
+ content: [{ type: 'text', text: `Account balance: ${JSON.stringify(balance, null, 2)}` }]
93
+ };
94
+ }
95
+ );
96
+
97
+ server.registerTool(
98
+ 'get_account_transactions',
99
+ {
100
+ title: 'Get Account Transactions',
101
+ description: 'Get all transactions linked to an account',
102
+ inputSchema: z.object({ id: z.string() })
103
+ },
104
+ async ({ id }) => {
105
+ const transactions = await apiClient.get(`/accounts/${id}/transactions`);
106
+ return {
107
+ content: [{ type: 'text', text: `Account transactions: ${JSON.stringify(transactions, null, 2)}` }]
108
+ };
109
+ }
110
+ );
111
+ }
@@ -0,0 +1,81 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateCategoryInput, UpdateCategoryInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+
6
+ export function registerCategoryTools(server: McpServer) {
7
+ server.registerTool(
8
+ 'create_category',
9
+ {
10
+ title: 'Create Category',
11
+ description: 'Create a new financial category (INCOME or EXPENSE)',
12
+ inputSchema: CreateCategoryInput
13
+ },
14
+ async (args) => {
15
+ const category = await apiClient.post('/categories', args);
16
+ return {
17
+ content: [{ type: 'text', text: `Category created: ${JSON.stringify(category, null, 2)}` }]
18
+ };
19
+ }
20
+ );
21
+
22
+ server.registerTool(
23
+ 'get_categories',
24
+ {
25
+ title: 'Get Categories',
26
+ description: 'List all financial categories',
27
+ inputSchema: z.object({})
28
+ },
29
+ async () => {
30
+ const categories = await apiClient.get('/categories');
31
+ return {
32
+ content: [{ type: 'text', text: `Categories: ${JSON.stringify(categories, null, 2)}` }]
33
+ };
34
+ }
35
+ );
36
+
37
+ server.registerTool(
38
+ 'get_category',
39
+ {
40
+ title: 'Get Category',
41
+ description: 'Get a category by ID',
42
+ inputSchema: z.object({ id: z.string() })
43
+ },
44
+ async ({ id }) => {
45
+ const category = await apiClient.get(`/categories/${id}`);
46
+ return {
47
+ content: [{ type: 'text', text: `Category: ${JSON.stringify(category, null, 2)}` }]
48
+ };
49
+ }
50
+ );
51
+
52
+ server.registerTool(
53
+ 'update_category',
54
+ {
55
+ title: 'Update Category',
56
+ description: 'Update a category',
57
+ inputSchema: UpdateCategoryInput
58
+ },
59
+ async ({ id, ...data }) => {
60
+ const category = await apiClient.patch(`/categories/${id}`, data);
61
+ return {
62
+ content: [{ type: 'text', text: `Category updated: ${JSON.stringify(category, null, 2)}` }]
63
+ };
64
+ }
65
+ );
66
+
67
+ server.registerTool(
68
+ 'delete_category',
69
+ {
70
+ title: 'Delete Category',
71
+ description: 'Delete a category by ID',
72
+ inputSchema: z.object({ id: z.string() })
73
+ },
74
+ async ({ id }) => {
75
+ await apiClient.delete(`/categories/${id}`);
76
+ return {
77
+ content: [{ type: 'text', text: `Category deleted successfully (ID: ${id})` }]
78
+ };
79
+ }
80
+ );
81
+ }
@@ -0,0 +1,132 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateCreditCardInput, UpdateCreditCardInput, PayStatementInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+
6
+ export function registerCreditCardTools(server: McpServer) {
7
+ server.registerTool(
8
+ 'create_credit_card',
9
+ {
10
+ title: 'Create Credit Card',
11
+ description: 'Create a new credit card account',
12
+ inputSchema: CreateCreditCardInput
13
+ },
14
+ async (args) => {
15
+ const card = await apiClient.post('/credit-cards', args);
16
+ return {
17
+ content: [{ type: 'text', text: `Credit Card created: ${JSON.stringify(card, null, 2)}` }]
18
+ };
19
+ }
20
+ );
21
+
22
+ server.registerTool(
23
+ 'get_credit_cards',
24
+ {
25
+ title: 'Get Credit Cards',
26
+ description: 'List all credit cards',
27
+ inputSchema: z.object({})
28
+ },
29
+ async () => {
30
+ const cards = await apiClient.get('/credit-cards');
31
+ return {
32
+ content: [{ type: 'text', text: `Credit Cards: ${JSON.stringify(cards, null, 2)}` }]
33
+ };
34
+ }
35
+ );
36
+
37
+ server.registerTool(
38
+ 'get_credit_card',
39
+ {
40
+ title: 'Get Credit Card',
41
+ description: 'Get a credit card by ID',
42
+ inputSchema: z.object({ id: z.string() })
43
+ },
44
+ async ({ id }) => {
45
+ const card = await apiClient.get(`/credit-cards/${id}`);
46
+ return {
47
+ content: [{ type: 'text', text: `Credit Card: ${JSON.stringify(card, null, 2)}` }]
48
+ };
49
+ }
50
+ );
51
+
52
+ server.registerTool(
53
+ 'update_credit_card',
54
+ {
55
+ title: 'Update Credit Card',
56
+ description: 'Update a credit card',
57
+ inputSchema: UpdateCreditCardInput
58
+ },
59
+ async ({ id, ...data }) => {
60
+ const card = await apiClient.patch(`/credit-cards/${id}`, data);
61
+ return {
62
+ content: [{ type: 'text', text: `Credit Card updated: ${JSON.stringify(card, null, 2)}` }]
63
+ };
64
+ }
65
+ );
66
+
67
+ server.registerTool(
68
+ 'delete_credit_card',
69
+ {
70
+ title: 'Delete Credit Card',
71
+ description: 'Delete a credit card by ID',
72
+ inputSchema: z.object({ id: z.string() })
73
+ },
74
+ async ({ id }) => {
75
+ await apiClient.delete(`/credit-cards/${id}`);
76
+ return {
77
+ content: [{ type: 'text', text: `Credit Card deleted successfully (ID: ${id})` }]
78
+ };
79
+ }
80
+ );
81
+
82
+ server.registerTool(
83
+ 'get_statement',
84
+ {
85
+ title: 'Get Statement',
86
+ description: 'Get credit card statement for a specific month',
87
+ inputSchema: z.object({
88
+ id: z.string().describe('Credit Card ID'),
89
+ month: z.string().describe('Month in YYYY-MM format')
90
+ })
91
+ },
92
+ async ({ id, month }) => {
93
+ const statement = await apiClient.get(`/credit-cards/${id}/statement?month=${month}`);
94
+ return {
95
+ content: [{ type: 'text', text: `Statement: ${JSON.stringify(statement, null, 2)}` }]
96
+ };
97
+ }
98
+ );
99
+
100
+ server.registerTool(
101
+ 'pay_statement',
102
+ {
103
+ title: 'Pay Statement',
104
+ description: 'Mark all transactions in a credit card statement as paid',
105
+ inputSchema: PayStatementInput
106
+ },
107
+ async ({ cardId, month, paymentAccountId }) => {
108
+ await apiClient.post(`/credit-cards/${cardId}/pay-statement`, { month, paymentAccountId });
109
+ return {
110
+ content: [{ type: 'text', text: `Statement for ${month} paid successfully.` }]
111
+ };
112
+ }
113
+ );
114
+
115
+ server.registerTool(
116
+ 'get_statement_status',
117
+ {
118
+ title: 'Get Statement Status',
119
+ description: 'Get credit card statement payment status',
120
+ inputSchema: z.object({
121
+ id: z.string().describe('Credit Card ID'),
122
+ month: z.string().describe('Month in YYYY-MM format')
123
+ })
124
+ },
125
+ async ({ id, month }) => {
126
+ const status = await apiClient.get(`/credit-cards/${id}/statement-status?month=${month}`);
127
+ return {
128
+ content: [{ type: 'text', text: `Statement Status: ${JSON.stringify(status, null, 2)}` }]
129
+ };
130
+ }
131
+ );
132
+ }
@@ -0,0 +1,51 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { CreateSettingsInput, UpdateSettingsInput } from '../types/schemas.js';
4
+ import { apiClient } from '../services/apiClient.js';
5
+
6
+ export function registerSettingsTools(server: McpServer) {
7
+ server.registerTool(
8
+ 'create_settings',
9
+ {
10
+ title: 'Create Settings',
11
+ description: 'Create global settings (only if not exists)',
12
+ inputSchema: CreateSettingsInput
13
+ },
14
+ async (args) => {
15
+ const settings = await apiClient.post('/settings', args);
16
+ return {
17
+ content: [{ type: 'text', text: `Settings created: ${JSON.stringify(settings, null, 2)}` }]
18
+ };
19
+ }
20
+ );
21
+
22
+ server.registerTool(
23
+ 'get_settings',
24
+ {
25
+ title: 'Get Settings',
26
+ description: 'Get global settings',
27
+ inputSchema: z.object({})
28
+ },
29
+ async () => {
30
+ const settings = await apiClient.get('/settings');
31
+ return {
32
+ content: [{ type: 'text', text: `Settings: ${JSON.stringify(settings, null, 2)}` }]
33
+ };
34
+ }
35
+ );
36
+
37
+ server.registerTool(
38
+ 'update_settings',
39
+ {
40
+ title: 'Update Settings',
41
+ description: 'Update global settings',
42
+ inputSchema: UpdateSettingsInput
43
+ },
44
+ async (args) => {
45
+ const settings = await apiClient.put('/settings', args);
46
+ return {
47
+ content: [{ type: 'text', text: `Settings updated: ${JSON.stringify(settings, null, 2)}` }]
48
+ };
49
+ }
50
+ );
51
+ }
@@ -0,0 +1,20 @@
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 monthly financial summary including income, expenses, and balance',
11
+ inputSchema: GetSummaryInput
12
+ },
13
+ async ({ month }) => {
14
+ const summary = await apiClient.get(`/summary?month=${month}`);
15
+ return {
16
+ content: [{ type: 'text', text: `Summary for ${month}: ${JSON.stringify(summary, null, 2)}` }]
17
+ };
18
+ }
19
+ );
20
+ }
@@ -0,0 +1,118 @@
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 for a specific month (optional)',
27
+ inputSchema: GetTransactionsInput
28
+ },
29
+ async ({ month }) => {
30
+ const url = month ? `/transactions?month=${month}` : '/transactions';
31
+ const transactions = await apiClient.get(url);
32
+ return {
33
+ content: [{ type: 'text', text: `Transactions: ${JSON.stringify(transactions, null, 2)}` }]
34
+ };
35
+ }
36
+ );
37
+
38
+ server.registerTool(
39
+ 'get_transaction',
40
+ {
41
+ title: 'Get Transaction',
42
+ description: 'Get a transaction by ID',
43
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
44
+ },
45
+ async ({ id }) => {
46
+ const transaction = await apiClient.get(`/transactions/${id}`);
47
+ return {
48
+ content: [{ type: 'text', text: `Transaction: ${JSON.stringify(transaction, null, 2)}` }]
49
+ };
50
+ }
51
+ );
52
+
53
+ server.registerTool(
54
+ 'update_transaction',
55
+ {
56
+ title: 'Update Transaction',
57
+ description: 'Update a transaction',
58
+ inputSchema: UpdateTransactionInput
59
+ },
60
+ async ({ id, mode, ...data }) => {
61
+ const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
62
+ const transaction = await apiClient.patch(url, data);
63
+ return {
64
+ content: [{ type: 'text', text: `Transaction updated: ${JSON.stringify(transaction, null, 2)}` }]
65
+ };
66
+ }
67
+ );
68
+
69
+ server.registerTool(
70
+ 'pay_transaction',
71
+ {
72
+ title: 'Pay Transaction',
73
+ description: 'Mark a transaction as paid/received',
74
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
75
+ },
76
+ async ({ id }) => {
77
+ // PATCH /transactions/{id}/pay
78
+ await apiClient.patch(`/transactions/${id}/pay`);
79
+ return {
80
+ content: [{ type: 'text', text: `Transaction ${id} marked as paid.` }]
81
+ };
82
+ }
83
+ );
84
+
85
+ server.registerTool(
86
+ 'unpay_transaction',
87
+ {
88
+ title: 'Unpay Transaction',
89
+ description: 'Mark a transaction as unpaid',
90
+ inputSchema: z.object({ id: z.string().describe("Transaction ID") })
91
+ },
92
+ async ({ id }) => {
93
+ await apiClient.patch(`/transactions/${id}/unpay`);
94
+ return {
95
+ content: [{ type: 'text', text: `Transaction ${id} marked as unpaid.` }]
96
+ };
97
+ }
98
+ );
99
+
100
+ server.registerTool(
101
+ 'delete_transaction',
102
+ {
103
+ title: 'Delete Transaction',
104
+ description: 'Delete a transaction by ID',
105
+ inputSchema: z.object({
106
+ id: z.string().describe("Transaction ID"),
107
+ mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional()
108
+ })
109
+ },
110
+ async ({ id, mode }) => {
111
+ const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
112
+ await apiClient.delete(url);
113
+ return {
114
+ content: [{ type: 'text', text: `Transaction ${id} deleted.` }]
115
+ };
116
+ }
117
+ );
118
+ }