quantix-mcp 0.4.9 → 0.5.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 (215) hide show
  1. package/README.md +12 -1
  2. package/dist/index.js +20 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/tools/subscriptions.d.ts.map +1 -1
  5. package/dist/tools/subscriptions.js +46 -1
  6. package/dist/tools/subscriptions.js.map +1 -1
  7. package/dist/tools/transactions.d.ts.map +1 -1
  8. package/dist/tools/transactions.js +5 -5
  9. package/dist/tools/transactions.js.map +1 -1
  10. package/dist/types/schemas.d.ts +17 -0
  11. package/dist/types/schemas.d.ts.map +1 -1
  12. package/dist/types/schemas.js +21 -4
  13. package/dist/types/schemas.js.map +1 -1
  14. package/package.json +9 -4
  15. package/.claude/commands/opsx/apply.md +0 -152
  16. package/.claude/commands/opsx/archive.md +0 -157
  17. package/.claude/commands/opsx/bulk-archive.md +0 -242
  18. package/.claude/commands/opsx/continue.md +0 -114
  19. package/.claude/commands/opsx/explore.md +0 -174
  20. package/.claude/commands/opsx/ff.md +0 -94
  21. package/.claude/commands/opsx/new.md +0 -69
  22. package/.claude/commands/opsx/onboard.md +0 -525
  23. package/.claude/commands/opsx/sync.md +0 -134
  24. package/.claude/commands/opsx/verify.md +0 -164
  25. package/.claude/settings.local.json +0 -9
  26. package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
  27. package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
  28. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  29. package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
  30. package/.claude/skills/openspec-explore/SKILL.md +0 -290
  31. package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
  32. package/.claude/skills/openspec-new-change/SKILL.md +0 -74
  33. package/.claude/skills/openspec-onboard/SKILL.md +0 -529
  34. package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
  35. package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
  36. package/.dockerignore +0 -8
  37. package/.gemini/commands/opsx/apply.toml +0 -149
  38. package/.gemini/commands/opsx/archive.toml +0 -154
  39. package/.gemini/commands/opsx/bulk-archive.toml +0 -239
  40. package/.gemini/commands/opsx/continue.toml +0 -111
  41. package/.gemini/commands/opsx/explore.toml +0 -171
  42. package/.gemini/commands/opsx/ff.toml +0 -91
  43. package/.gemini/commands/opsx/new.toml +0 -66
  44. package/.gemini/commands/opsx/onboard.toml +0 -522
  45. package/.gemini/commands/opsx/sync.toml +0 -131
  46. package/.gemini/commands/opsx/verify.toml +0 -161
  47. package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
  48. package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
  49. package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  50. package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
  51. package/.gemini/skills/openspec-explore/SKILL.md +0 -290
  52. package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
  53. package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
  54. package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
  55. package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
  56. package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
  57. package/.github/agents/copilot-instructions.md +0 -32
  58. package/.github/agents/speckit.analyze.agent.md +0 -184
  59. package/.github/agents/speckit.checklist.agent.md +0 -294
  60. package/.github/agents/speckit.clarify.agent.md +0 -181
  61. package/.github/agents/speckit.constitution.agent.md +0 -82
  62. package/.github/agents/speckit.implement.agent.md +0 -135
  63. package/.github/agents/speckit.plan.agent.md +0 -89
  64. package/.github/agents/speckit.specify.agent.md +0 -258
  65. package/.github/agents/speckit.tasks.agent.md +0 -137
  66. package/.github/agents/speckit.taskstoissues.agent.md +0 -30
  67. package/.github/copilot-instructions.md +0 -17
  68. package/.github/prompts/speckit.analyze.prompt.md +0 -3
  69. package/.github/prompts/speckit.checklist.prompt.md +0 -3
  70. package/.github/prompts/speckit.clarify.prompt.md +0 -3
  71. package/.github/prompts/speckit.constitution.prompt.md +0 -3
  72. package/.github/prompts/speckit.implement.prompt.md +0 -3
  73. package/.github/prompts/speckit.plan.prompt.md +0 -3
  74. package/.github/prompts/speckit.specify.prompt.md +0 -3
  75. package/.github/prompts/speckit.tasks.prompt.md +0 -3
  76. package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
  77. package/.github/workflows/publish.yaml +0 -29
  78. package/.opencode/command/speckit.analyze.md +0 -184
  79. package/.opencode/command/speckit.checklist.md +0 -294
  80. package/.opencode/command/speckit.clarify.md +0 -181
  81. package/.opencode/command/speckit.constitution.md +0 -84
  82. package/.opencode/command/speckit.implement.md +0 -135
  83. package/.opencode/command/speckit.plan.md +0 -89
  84. package/.opencode/command/speckit.specify.md +0 -258
  85. package/.opencode/command/speckit.tasks.md +0 -137
  86. package/.opencode/command/speckit.taskstoissues.md +0 -30
  87. package/.qwen/commands/opsx-apply.toml +0 -149
  88. package/.qwen/commands/opsx-archive.toml +0 -154
  89. package/.qwen/commands/opsx-bulk-archive.toml +0 -239
  90. package/.qwen/commands/opsx-continue.toml +0 -111
  91. package/.qwen/commands/opsx-explore.toml +0 -171
  92. package/.qwen/commands/opsx-ff.toml +0 -91
  93. package/.qwen/commands/opsx-new.toml +0 -66
  94. package/.qwen/commands/opsx-onboard.toml +0 -522
  95. package/.qwen/commands/opsx-sync.toml +0 -131
  96. package/.qwen/commands/opsx-verify.toml +0 -161
  97. package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
  98. package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
  99. package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
  100. package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
  101. package/.qwen/skills/openspec-explore/SKILL.md +0 -290
  102. package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
  103. package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
  104. package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
  105. package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
  106. package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
  107. package/.specify/memory/constitution.md +0 -58
  108. package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
  109. package/.specify/scripts/powershell/common.ps1 +0 -137
  110. package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
  111. package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
  112. package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
  113. package/.specify/templates/agent-file-template.md +0 -28
  114. package/.specify/templates/checklist-template.md +0 -40
  115. package/.specify/templates/constitution-template.md +0 -50
  116. package/.specify/templates/plan-template.md +0 -104
  117. package/.specify/templates/spec-template.md +0 -115
  118. package/.specify/templates/tasks-template.md +0 -251
  119. package/.vscode/launch.json +0 -14
  120. package/.vscode/settings.json +0 -14
  121. package/.vscode/tasks.json +0 -15
  122. package/AGENTS.md +0 -117
  123. package/CLAUDE.md +0 -70
  124. package/Dockerfile +0 -30
  125. package/GEMINI.md +0 -117
  126. package/QWEN.md +0 -117
  127. package/docker-compose.yml +0 -15
  128. package/openapi.yaml +0 -3127
  129. package/openspec/README.md +0 -33
  130. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
  131. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
  132. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
  133. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
  134. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
  135. package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
  136. package/openspec/config.yaml +0 -20
  137. package/openspec/specs/accounts/spec.md +0 -86
  138. package/openspec/specs/categories/spec.md +0 -78
  139. package/openspec/specs/credit-card-transactions/spec.md +0 -64
  140. package/openspec/specs/credit-cards/spec.md +0 -109
  141. package/openspec/specs/data/spec.md +0 -49
  142. package/openspec/specs/settings/spec.md +0 -48
  143. package/openspec/specs/subscriptions/spec.md +0 -85
  144. package/openspec/specs/summary/spec.md +0 -49
  145. package/openspec/specs/transactions/spec.md +0 -113
  146. package/openspec/specs/transfers/spec.md +0 -74
  147. package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
  148. package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
  149. package/specs/001-mcp-api-integration/data-model.md +0 -106
  150. package/specs/001-mcp-api-integration/plan.md +0 -73
  151. package/specs/001-mcp-api-integration/quickstart.md +0 -74
  152. package/specs/001-mcp-api-integration/research.md +0 -58
  153. package/specs/001-mcp-api-integration/spec.md +0 -119
  154. package/specs/001-mcp-api-integration/tasks.md +0 -64
  155. package/src/config.ts +0 -39
  156. package/src/index.ts +0 -99
  157. package/src/services/apiClient.ts +0 -55
  158. package/src/services/requestContext.ts +0 -11
  159. package/src/tools/accounts.ts +0 -122
  160. package/src/tools/categories.ts +0 -102
  161. package/src/tools/credit-cards.ts +0 -203
  162. package/src/tools/data.ts +0 -45
  163. package/src/tools/settings.ts +0 -64
  164. package/src/tools/subscriptions.ts +0 -159
  165. package/src/tools/summary.ts +0 -29
  166. package/src/tools/transactions.ts +0 -200
  167. package/src/tools/transfers.ts +0 -122
  168. package/src/types/schemas.ts +0 -333
  169. package/src/utils/toolHelpers.ts +0 -11
  170. package/tests/benchmark.test.d.ts +0 -2
  171. package/tests/benchmark.test.d.ts.map +0 -1
  172. package/tests/benchmark.test.js +0 -33
  173. package/tests/benchmark.test.js.map +0 -1
  174. package/tests/benchmark.test.ts +0 -38
  175. package/tests/server.test.d.ts +0 -2
  176. package/tests/server.test.d.ts.map +0 -1
  177. package/tests/server.test.js +0 -13
  178. package/tests/server.test.js.map +0 -1
  179. package/tests/server.test.ts +0 -14
  180. package/tests/setup.d.ts +0 -4
  181. package/tests/setup.d.ts.map +0 -1
  182. package/tests/setup.js +0 -17
  183. package/tests/setup.js.map +0 -1
  184. package/tests/setup.ts +0 -20
  185. package/tests/tools/accounts.test.ts +0 -159
  186. package/tests/tools/categories.test.d.ts +0 -2
  187. package/tests/tools/categories.test.d.ts.map +0 -1
  188. package/tests/tools/categories.test.js +0 -63
  189. package/tests/tools/categories.test.js.map +0 -1
  190. package/tests/tools/categories.test.ts +0 -120
  191. package/tests/tools/credit-cards.test.d.ts +0 -2
  192. package/tests/tools/credit-cards.test.d.ts.map +0 -1
  193. package/tests/tools/credit-cards.test.js +0 -71
  194. package/tests/tools/credit-cards.test.js.map +0 -1
  195. package/tests/tools/credit-cards.test.ts +0 -131
  196. package/tests/tools/data.test.ts +0 -100
  197. package/tests/tools/settings.test.ts +0 -116
  198. package/tests/tools/subscriptions.test.ts +0 -173
  199. package/tests/tools/summary.test.d.ts +0 -2
  200. package/tests/tools/summary.test.d.ts.map +0 -1
  201. package/tests/tools/summary.test.js +0 -36
  202. package/tests/tools/summary.test.js.map +0 -1
  203. package/tests/tools/summary.test.ts +0 -63
  204. package/tests/tools/transactions.test.d.ts +0 -2
  205. package/tests/tools/transactions.test.d.ts.map +0 -1
  206. package/tests/tools/transactions.test.js +0 -67
  207. package/tests/tools/transactions.test.js.map +0 -1
  208. package/tests/tools/transactions.test.ts +0 -133
  209. package/tests/tools/transfers.test.ts +0 -141
  210. package/tsconfig.json +0 -52
  211. package/vitest.config.d.ts +0 -3
  212. package/vitest.config.d.ts.map +0 -1
  213. package/vitest.config.js +0 -14
  214. package/vitest.config.js.map +0 -1
  215. package/vitest.config.ts +0 -14
@@ -1,29 +0,0 @@
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,200 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { z } from 'zod';
3
- import {
4
- CreateTransactionInput,
5
- GetTransactionsInput,
6
- UpdateTransactionInput,
7
- CreateCreditCardTransactionInput,
8
- UpdateCreditCardTransactionInput
9
- } from '../types/schemas.js';
10
- import { apiClient } from '../services/apiClient.js';
11
- import { handleToolError } from '../utils/toolHelpers.js';
12
-
13
- export function registerTransactionTools(server: McpServer) {
14
- server.registerTool(
15
- 'create_transaction',
16
- {
17
- title: 'Create Transaction',
18
- description: 'Record a new income or expense using direct payment methods (CASH, PIX, or DEBIT only). For credit card purchases, use create_credit_transaction instead.',
19
- inputSchema: CreateTransactionInput
20
- },
21
- async (args) => {
22
- try {
23
- const transaction = await apiClient.post('/transactions', args);
24
- return {
25
- content: [{ type: 'text', text: `Transaction created: ${JSON.stringify(transaction, null, 2)}` }]
26
- };
27
- } catch (error) {
28
- return handleToolError(error);
29
- }
30
- }
31
- );
32
-
33
- server.registerTool(
34
- 'get_transactions',
35
- {
36
- title: 'Get Transactions',
37
- description: 'List transactions with optional filters (month, date range, account, category, credit card, type, paid status)',
38
- inputSchema: GetTransactionsInput
39
- },
40
- async (args) => {
41
- try {
42
- const params = new URLSearchParams();
43
- if (args.month) params.append('month', args.month);
44
- if (args.accountId) params.append('accountId', args.accountId);
45
- if (args.categoryId) params.append('categoryId', args.categoryId);
46
- if (args.creditCardId) params.append('creditCardId', args.creditCardId);
47
- if (args.type) params.append('type', args.type);
48
- if (args.startDate) params.append('startDate', args.startDate);
49
- if (args.endDate) params.append('endDate', args.endDate);
50
- if (args.paid !== undefined) params.append('paid', String(args.paid));
51
- const qs = params.toString();
52
- const url = qs ? `/transactions?${qs}` : '/transactions';
53
- const transactions = await apiClient.get(url);
54
- return {
55
- content: [{ type: 'text', text: `Transactions: ${JSON.stringify(transactions, null, 2)}` }]
56
- };
57
- } catch (error) {
58
- return handleToolError(error);
59
- }
60
- }
61
- );
62
-
63
- server.registerTool(
64
- 'get_transaction',
65
- {
66
- title: 'Get Transaction',
67
- description: 'Get a transaction by ID',
68
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
69
- },
70
- async ({ id }) => {
71
- try {
72
- const transaction = await apiClient.get(`/transactions/${id}`);
73
- return {
74
- content: [{ type: 'text', text: `Transaction: ${JSON.stringify(transaction, null, 2)}` }]
75
- };
76
- } catch (error) {
77
- return handleToolError(error);
78
- }
79
- }
80
- );
81
-
82
- server.registerTool(
83
- 'update_transaction',
84
- {
85
- title: 'Update Transaction',
86
- description: 'Update a transaction using direct payment methods (CASH, PIX, or DEBIT only). For credit card transactions, use update_credit_transaction instead.',
87
- inputSchema: UpdateTransactionInput
88
- },
89
- async ({ id, mode, ...data }) => {
90
- try {
91
- const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
92
- const transaction = await apiClient.patch(url, data);
93
- return {
94
- content: [{ type: 'text', text: `Transaction updated: ${JSON.stringify(transaction, null, 2)}` }]
95
- };
96
- } catch (error) {
97
- return handleToolError(error);
98
- }
99
- }
100
- );
101
-
102
- server.registerTool(
103
- 'pay_transaction',
104
- {
105
- title: 'Pay Transaction',
106
- description: 'Mark a transaction as paid/received',
107
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
108
- },
109
- async ({ id }) => {
110
- try {
111
- const transaction = await apiClient.patch(`/transactions/${id}/pay`);
112
- return {
113
- content: [{ type: 'text', text: `Transaction marked as paid: ${JSON.stringify(transaction, null, 2)}` }]
114
- };
115
- } catch (error) {
116
- return handleToolError(error);
117
- }
118
- }
119
- );
120
-
121
- server.registerTool(
122
- 'unpay_transaction',
123
- {
124
- title: 'Unpay Transaction',
125
- description: 'Mark a transaction as unpaid',
126
- inputSchema: z.object({ id: z.string().describe("Transaction ID") })
127
- },
128
- async ({ id }) => {
129
- try {
130
- const transaction = await apiClient.patch(`/transactions/${id}/unpay`);
131
- return {
132
- content: [{ type: 'text', text: `Transaction marked as unpaid: ${JSON.stringify(transaction, null, 2)}` }]
133
- };
134
- } catch (error) {
135
- return handleToolError(error);
136
- }
137
- }
138
- );
139
-
140
- server.registerTool(
141
- 'delete_transaction',
142
- {
143
- title: 'Delete Transaction',
144
- description: 'Delete a transaction by ID',
145
- inputSchema: z.object({
146
- id: z.string().describe("Transaction ID"),
147
- mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional()
148
- })
149
- },
150
- async ({ id, mode }) => {
151
- try {
152
- const url = mode ? `/transactions/${id}?mode=${mode}` : `/transactions/${id}`;
153
- await apiClient.delete(url);
154
- return {
155
- content: [{ type: 'text', text: `Transaction ${id} deleted.` }]
156
- };
157
- } catch (error) {
158
- return handleToolError(error);
159
- }
160
- }
161
- );
162
-
163
- server.registerTool(
164
- 'create_credit_transaction',
165
- {
166
- title: 'Create Credit Card Transaction',
167
- description: 'Record a new credit card purchase. The due date is automatically calculated based on the purchase date and the card closing day. Use targetDueMonth to specify a particular billing month.',
168
- inputSchema: CreateCreditCardTransactionInput
169
- },
170
- async (args) => {
171
- try {
172
- const transaction = await apiClient.post('/transactions/credit', args);
173
- return {
174
- content: [{ type: 'text', text: `Credit card transaction created: ${JSON.stringify(transaction, null, 2)}` }]
175
- };
176
- } catch (error) {
177
- return handleToolError(error);
178
- }
179
- }
180
- );
181
-
182
- server.registerTool(
183
- 'update_credit_transaction',
184
- {
185
- title: 'Update Credit Card Transaction',
186
- description: 'Update a credit card transaction. If purchaseDate or targetDueMonth is changed, the due date is recalculated.',
187
- inputSchema: UpdateCreditCardTransactionInput
188
- },
189
- async ({ id, ...data }) => {
190
- try {
191
- const transaction = await apiClient.patch(`/transactions/credit/${id}`, data);
192
- return {
193
- content: [{ type: 'text', text: `Credit card transaction updated: ${JSON.stringify(transaction, null, 2)}` }]
194
- };
195
- } catch (error) {
196
- return handleToolError(error);
197
- }
198
- }
199
- );
200
- }
@@ -1,122 +0,0 @@
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
- }
@@ -1,333 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // --- Transfer Entities ---
4
- export const TransferSchema = z.object({
5
- id: z.string(),
6
- sourceAccountId: z.string(),
7
- destinationAccountId: z.string(),
8
- amount: z.number().min(0.01),
9
- date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
10
- createdAt: z.string().datetime().optional(),
11
- updatedAt: z.string().datetime().optional(),
12
- });
13
-
14
- export const CreateTransferRequestSchema = z.object({
15
- sourceAccountId: z.string().describe("Source account ID (required — must ask the user if not provided, do not assume or default)"),
16
- destinationAccountId: z.string().describe("Destination account ID (required — must ask the user if not provided, do not assume or default)"),
17
- amount: z.number().min(0.01).describe("Transfer amount (required — must ask the user if not provided, do not assume or default)"),
18
- date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Transfer date (required — must ask the user if not provided, do not assume or default)"),
19
- });
20
-
21
- export const UpdateTransferRequestSchema = z.object({
22
- sourceAccountId: z.string().optional(),
23
- destinationAccountId: z.string().optional(),
24
- amount: z.number().min(0.01).optional(),
25
- date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
26
- });
27
-
28
- // --- Domain Entities ---
29
-
30
- export const CategorySchema = z.object({
31
- id: z.string(),
32
- name: z.string(),
33
- type: z.enum(["INCOME", "EXPENSE"]),
34
- color: z.string().optional(),
35
- createdAt: z.string().datetime().optional()
36
- });
37
-
38
- export const TransactionSchema = z.object({
39
- id: z.string(),
40
- type: z.enum(["INCOME", "EXPENSE"]),
41
- name: z.string(),
42
- amount: z.number().min(0),
43
- date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Invalid date format YYYY-MM-DD"),
44
- categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
45
- paymentMethod: z.enum(["CASH", "PIX", "DEBIT", "CREDIT"]).optional(),
46
- creditCardId: z.string().describe("ID do cartão de crédito (obrigatório se o método de pagamento for CREDIT; use get_credit_cards para encontrar o ID)").optional(),
47
- installmentGroupId: z.string().optional(),
48
- installmentNumber: z.number().int().optional(),
49
- installmentTotal: z.number().int().optional(),
50
- recurrenceRuleId: z.string().optional(),
51
- accountId: z.string().describe("ID da conta bancária (obrigatório se o método de pagamento NÃO for CREDIT; use get_accounts para encontrar o ID)").optional(),
52
- paid: z.boolean().default(false),
53
- createdAt: z.string().datetime().optional()
54
- });
55
-
56
- export const CreditCardSchema = z.object({
57
- id: z.string(),
58
- name: z.string(),
59
- brand: z.string().optional(),
60
- limitAmount: z.number().min(0),
61
- closingDay: z.number().int().min(1).max(31),
62
- dueDay: z.number().int().min(1).max(31),
63
- createdAt: z.string().datetime().optional()
64
- });
65
-
66
- export const AccountSchema = z.object({
67
- id: z.string(),
68
- name: z.string(),
69
- type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]),
70
- initialBalance: z.number(),
71
- currentBalance: z.number().optional(),
72
- createdAt: z.string().datetime().optional(),
73
- updatedAt: z.string().datetime().optional()
74
- });
75
-
76
- export const AccountBalanceSchema = z.object({
77
- accountId: z.string(),
78
- currentBalance: z.number(),
79
- calculatedAt: z.string().datetime()
80
- });
81
-
82
- export const StatementSchema = z.object({
83
- cardId: z.string(),
84
- periodStart: z.string(),
85
- periodEnd: z.string(),
86
- dueDate: z.string(),
87
- transactions: z.array(TransactionSchema).optional(),
88
- total: z.number(),
89
- availableLimit: z.number()
90
- });
91
-
92
- export const StatementStatusSchema = z.object({
93
- cardId: z.string(),
94
- month: z.string(),
95
- isPaid: z.boolean()
96
- });
97
-
98
- export const SummarySchema = z.object({
99
- period: z.object({
100
- month: z.string().optional(),
101
- startDate: z.string().optional(),
102
- endDate: z.string().optional()
103
- }).optional(),
104
- income: z.number(),
105
- expenses: z.number(),
106
- pendingIncome: z.number().optional(),
107
- pendingExpenses: z.number().optional(),
108
- balance: z.number(),
109
- creditCardExpenses: z.array(z.any()).optional(),
110
- expensesByCategory: z.array(z.any()).optional(),
111
- incomeByCategory: z.array(z.any()).optional(),
112
- accounts: z.array(z.any()).optional(),
113
- totalBalance: z.number().optional()
114
- });
115
-
116
- export const SettingsSchema = z.object({
117
- userName: z.string(),
118
- language: z.enum(["pt-BR", "en-US"]),
119
- currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"]),
120
- createdAt: z.string().datetime().optional(),
121
- updatedAt: z.string().datetime().optional()
122
- });
123
-
124
- // --- Tool Inputs ---
125
-
126
- export const CreateCategoryInput = z.object({
127
- name: z.string(),
128
- type: z.enum(["INCOME", "EXPENSE"]),
129
- color: z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color").optional()
130
- });
131
-
132
- export const UpdateCategoryInput = z.object({
133
- id: z.string(),
134
- name: z.string().optional(),
135
- color: z.string().regex(/^#[0-9A-Fa-f]{6}$/, "Invalid hex color").optional()
136
- });
137
-
138
- export const CreateCreditCardInput = z.object({
139
- name: z.string(),
140
- brand: z.string().optional(),
141
- limitAmount: z.number().min(0),
142
- closingDay: z.number().int().min(1).max(31),
143
- dueDay: z.number().int().min(1).max(31)
144
- });
145
-
146
- export const UpdateCreditCardInput = z.object({
147
- id: z.string(),
148
- name: z.string().optional(),
149
- brand: z.string().optional(),
150
- limitAmount: z.number().min(0).optional(),
151
- closingDay: z.number().int().min(1).max(31).optional(),
152
- dueDay: z.number().int().min(1).max(31).optional()
153
- });
154
-
155
- export const CreateTransactionInput = z.object({
156
- type: z.enum(["INCOME", "EXPENSE"]),
157
- name: z.string(),
158
- amount: z.number().nonnegative().describe("Transaction amount (required — must ask the user if not provided, do not assume or default)"),
159
- date: z.string().describe("ISO date string YYYY-MM-DD"),
160
- categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
161
- paymentMethod: z.enum(["CASH", "PIX", "DEBIT"]).describe("Método de pagamento direto (CASH, PIX ou DEBIT — para cartão de crédito, use create_credit_transaction)").optional(),
162
- accountId: z.string().describe("ID da conta bancária (use get_accounts para encontrar o ID)").optional(),
163
- installments: z.number().int().min(1).optional(),
164
- isPaid: z.boolean().describe("Indica se a transação já foi paga ou recebida (use este campo em vez de 'paid')").optional(),
165
- recurrence: z.object({
166
- frequency: z.enum(["MONTHLY", "WEEKLY", "YEARLY"]),
167
- interval: z.number().int().min(1).optional(),
168
- endDate: z.string().optional(),
169
- occurrences: z.number().int().min(2).describe("Number of occurrences (mutually exclusive with endDate)").optional()
170
- }).optional()
171
- });
172
-
173
- export const UpdateTransactionInput = z.object({
174
- id: z.string(),
175
- mode: z.enum(["SINGLE", "PENDING", "ALL"]).default("SINGLE").optional(),
176
- type: z.enum(["INCOME", "EXPENSE"]).optional(),
177
- name: z.string().optional(),
178
- amount: z.number().nonnegative().optional(),
179
- date: z.string().describe("ISO date string YYYY-MM-DD").optional(),
180
- categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
181
- paymentMethod: z.enum(["CASH", "PIX", "DEBIT"]).describe("Método de pagamento direto (CASH, PIX ou DEBIT — para cartão de crédito, use update_credit_transaction)").optional(),
182
- accountId: z.string().describe("ID da conta bancária (use get_accounts para encontrar o ID)").optional(),
183
- installments: z.number().int().min(1).optional(),
184
- isPaid: z.boolean().optional(),
185
- recurrence: z.object({
186
- frequency: z.enum(["MONTHLY", "WEEKLY", "YEARLY"]).optional(),
187
- interval: z.number().int().min(1).optional(),
188
- endDate: z.string().optional(),
189
- occurrences: z.number().int().min(2).describe("Number of occurrences (mutually exclusive with endDate)").optional()
190
- }).optional()
191
- });
192
-
193
- // --- Credit Card Transaction Tool Inputs ---
194
-
195
- export const CreditCardRecurrenceSchema = z.object({
196
- frequency: z.enum(["WEEKLY", "BIWEEKLY", "MONTHLY", "BIMONTHLY", "QUARTERLY", "SEMIANNUALLY", "ANNUALLY"]),
197
- interval: z.number().int().min(1).default(1).optional(),
198
- startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Start date for recurrence (defaults to purchase date)").optional(),
199
- endDate: z.string().optional(),
200
- occurrences: z.number().int().min(2).describe("Number of occurrences (optional)").optional()
201
- });
202
-
203
- export const CreateCreditCardTransactionInput = z.object({
204
- name: z.string().describe("Name or description of the transaction"),
205
- amount: z.number().min(0).describe("Total amount of the transaction (required — must ask the user if not provided, do not assume or default)"),
206
- purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Purchase date in YYYY-MM-DD format").describe("Actual purchase date (the day you bought the item)"),
207
- creditCardId: z.string().describe("ID of the credit card to charge (use get_credit_cards to find the ID)"),
208
- categoryId: z.string().describe("ID of the associated category (use get_categories to find the ID)").optional(),
209
- installments: z.number().int().min(1).describe("Number of installments (optional)").optional(),
210
- targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/, "Target month in YYYY-MM format").describe("Target month for due date (optional)").optional(),
211
- isPaid: z.boolean().describe("Whether the transaction has been paid").optional(),
212
- recurrence: CreditCardRecurrenceSchema.optional()
213
- });
214
-
215
- export const UpdateCreditCardTransactionInput = z.object({
216
- id: z.string().describe("Credit card transaction ID"),
217
- name: z.string().describe("Name or description of the transaction").optional(),
218
- amount: z.number().min(0).describe("Total amount of the transaction").optional(),
219
- purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Purchase date in YYYY-MM-DD format").describe("Actual purchase date").optional(),
220
- creditCardId: z.string().describe("ID of the credit card").optional(),
221
- categoryId: z.string().describe("ID of the associated category").optional(),
222
- installments: z.number().int().min(1).describe("Number of installments").optional(),
223
- targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/, "Target month in YYYY-MM format").describe("Target month for due date").optional(),
224
- isPaid: z.boolean().optional(),
225
- recurrence: CreditCardRecurrenceSchema.optional()
226
- });
227
-
228
- export const CreateAccountInput = z.object({
229
- name: z.string(),
230
- type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]),
231
- initialBalance: z.number().optional()
232
- });
233
-
234
- export const UpdateAccountInput = z.object({
235
- id: z.string(),
236
- name: z.string().optional(),
237
- type: z.enum(["BANK_ACCOUNT", "WALLET", "SAVINGS_ACCOUNT", "INVESTMENT_ACCOUNT", "OTHER"]).optional(),
238
- initialBalance: z.number().optional()
239
- });
240
-
241
- export const GetTransactionsInput = z.object({
242
- month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe("Filter by month, format: YYYY-MM").optional(),
243
- accountId: z.string().describe("Filter by account ID").optional(),
244
- categoryId: z.string().describe("Filter by category ID").optional(),
245
- creditCardId: z.string().describe("Filter by credit card ID").optional(),
246
- type: z.enum(["INCOME", "EXPENSE"]).describe("Filter by transaction type").optional(),
247
- startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Filter from this date (inclusive), YYYY-MM-DD").optional(),
248
- endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Filter up to this date (inclusive), YYYY-MM-DD").optional(),
249
- paid: z.boolean().describe("Filter by payment status (true = paid, false = unpaid)").optional()
250
- });
251
-
252
- export const PayStatementInput = z.object({
253
- cardId: z.string(),
254
- month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM"),
255
- paymentAccountId: z.string()
256
- });
257
-
258
- export const ReopenStatementInput = z.object({
259
- cardId: z.string().describe('Credit card ID'),
260
- month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe('Month in YYYY-MM format')
261
- });
262
-
263
- export const GetSummaryInput = z.object({
264
- month: z.string().regex(/^\d{4}-\d{2}$/, "Format: YYYY-MM").describe("Month in YYYY-MM format (use this OR startDate+endDate)").optional(),
265
- startDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("Start date for custom range, YYYY-MM-DD (use with endDate)").optional(),
266
- endDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe("End date for custom range, YYYY-MM-DD (use with startDate)").optional()
267
- });
268
-
269
- export const CreateSettingsInput = z.object({
270
- userName: z.string(),
271
- language: z.enum(["pt-BR", "en-US"]),
272
- currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"])
273
- });
274
-
275
- export const UpdateSettingsInput = z.object({
276
- userName: z.string().optional(),
277
- language: z.enum(["pt-BR", "en-US"]).optional(),
278
- currency: z.enum(["BRL", "USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF"]).optional()
279
- });
280
-
281
- export const CreateAnticipationInput = z.object({
282
- cardId: z.string().describe('Credit card ID'),
283
- name: z.string().describe('Name/description of the anticipation'),
284
- amount: z.number().min(0.01).describe('Amount to anticipate'),
285
- purchaseDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).describe('Date the money leaves the account (YYYY-MM-DD)'),
286
- targetDueMonth: z.string().regex(/^\d{4}-\d{2}$/).describe('Target statement due month (YYYY-MM)'),
287
- accountId: z.string().describe('Account ID from which money will be debited'),
288
- categoryId: z.string().optional().describe('Category ID for both transactions')
289
- });
290
-
291
- export const ImportDataInput = z.object({
292
- mode: z.enum(["reset", "increment"]).describe("reset: clears all data before import; increment: adds new records, skipping existing IDs"),
293
- version: z.string().describe('Export format version, must be "1.0"'),
294
- exportedAt: z.string().datetime().describe("ISO timestamp of when the data was exported"),
295
- data: z.object({
296
- settings: z.any().nullable().optional(),
297
- categories: z.array(z.any()).optional(),
298
- accounts: z.array(z.any()).optional(),
299
- creditCards: z.array(z.any()).optional(),
300
- recurrenceRules: z.array(z.any()).optional(),
301
- transactions: z.array(z.any()).optional()
302
- })
303
- });
304
-
305
- export const SubscriptionSchema = z.object({
306
- id: z.string(),
307
- name: z.string(),
308
- amount: z.number().min(0.01),
309
- billingDay: z.number().int().min(1).max(31),
310
- creditCardId: z.string(),
311
- categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
312
- active: z.boolean(),
313
- createdAt: z.string().datetime().optional(),
314
- updatedAt: z.string().datetime().optional()
315
- });
316
-
317
- export const CreateSubscriptionInput = z.object({
318
- name: z.string().describe("Name of the subscription (e.g., Netflix, Spotify)"),
319
- amount: z.number().min(0.01).describe("Monthly amount charged"),
320
- billingDay: z.number().int().min(1).max(31).describe("Day of the month when the subscription is charged (1-31)"),
321
- creditCardId: z.string().describe("ID of the credit card used for this subscription"),
322
- categoryId: z.string().describe("ID of the expense category").optional()
323
- });
324
-
325
- export const UpdateSubscriptionInput = z.object({
326
- id: z.string(),
327
- name: z.string().optional(),
328
- amount: z.number().min(0.01).optional(),
329
- billingDay: z.number().int().min(1).max(31).optional(),
330
- creditCardId: z.string().describe("ID do cartão de crédito (obrigatório se o método de pagamento for CREDIT; use get_credit_cards para encontrar o ID)").optional(),
331
- categoryId: z.string().describe("ID da categoria associada (use a ferramenta get_categories para encontrar o ID correto)").optional(),
332
- active: z.boolean().optional()
333
- });