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.
- package/README.md +12 -1
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/subscriptions.d.ts.map +1 -1
- package/dist/tools/subscriptions.js +46 -1
- package/dist/tools/subscriptions.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +5 -5
- package/dist/tools/transactions.js.map +1 -1
- package/dist/types/schemas.d.ts +17 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +21 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +9 -4
- package/.claude/commands/opsx/apply.md +0 -152
- package/.claude/commands/opsx/archive.md +0 -157
- package/.claude/commands/opsx/bulk-archive.md +0 -242
- package/.claude/commands/opsx/continue.md +0 -114
- package/.claude/commands/opsx/explore.md +0 -174
- package/.claude/commands/opsx/ff.md +0 -94
- package/.claude/commands/opsx/new.md +0 -69
- package/.claude/commands/opsx/onboard.md +0 -525
- package/.claude/commands/opsx/sync.md +0 -134
- package/.claude/commands/opsx/verify.md +0 -164
- package/.claude/settings.local.json +0 -9
- package/.claude/skills/openspec-apply-change/SKILL.md +0 -156
- package/.claude/skills/openspec-archive-change/SKILL.md +0 -114
- package/.claude/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.claude/skills/openspec-continue-change/SKILL.md +0 -118
- package/.claude/skills/openspec-explore/SKILL.md +0 -290
- package/.claude/skills/openspec-ff-change/SKILL.md +0 -101
- package/.claude/skills/openspec-new-change/SKILL.md +0 -74
- package/.claude/skills/openspec-onboard/SKILL.md +0 -529
- package/.claude/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.claude/skills/openspec-verify-change/SKILL.md +0 -168
- package/.dockerignore +0 -8
- package/.gemini/commands/opsx/apply.toml +0 -149
- package/.gemini/commands/opsx/archive.toml +0 -154
- package/.gemini/commands/opsx/bulk-archive.toml +0 -239
- package/.gemini/commands/opsx/continue.toml +0 -111
- package/.gemini/commands/opsx/explore.toml +0 -171
- package/.gemini/commands/opsx/ff.toml +0 -91
- package/.gemini/commands/opsx/new.toml +0 -66
- package/.gemini/commands/opsx/onboard.toml +0 -522
- package/.gemini/commands/opsx/sync.toml +0 -131
- package/.gemini/commands/opsx/verify.toml +0 -161
- package/.gemini/skills/openspec-apply-change/SKILL.md +0 -156
- package/.gemini/skills/openspec-archive-change/SKILL.md +0 -114
- package/.gemini/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.gemini/skills/openspec-continue-change/SKILL.md +0 -118
- package/.gemini/skills/openspec-explore/SKILL.md +0 -290
- package/.gemini/skills/openspec-ff-change/SKILL.md +0 -101
- package/.gemini/skills/openspec-new-change/SKILL.md +0 -74
- package/.gemini/skills/openspec-onboard/SKILL.md +0 -529
- package/.gemini/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.gemini/skills/openspec-verify-change/SKILL.md +0 -168
- package/.github/agents/copilot-instructions.md +0 -32
- package/.github/agents/speckit.analyze.agent.md +0 -184
- package/.github/agents/speckit.checklist.agent.md +0 -294
- package/.github/agents/speckit.clarify.agent.md +0 -181
- package/.github/agents/speckit.constitution.agent.md +0 -82
- package/.github/agents/speckit.implement.agent.md +0 -135
- package/.github/agents/speckit.plan.agent.md +0 -89
- package/.github/agents/speckit.specify.agent.md +0 -258
- package/.github/agents/speckit.tasks.agent.md +0 -137
- package/.github/agents/speckit.taskstoissues.agent.md +0 -30
- package/.github/copilot-instructions.md +0 -17
- package/.github/prompts/speckit.analyze.prompt.md +0 -3
- package/.github/prompts/speckit.checklist.prompt.md +0 -3
- package/.github/prompts/speckit.clarify.prompt.md +0 -3
- package/.github/prompts/speckit.constitution.prompt.md +0 -3
- package/.github/prompts/speckit.implement.prompt.md +0 -3
- package/.github/prompts/speckit.plan.prompt.md +0 -3
- package/.github/prompts/speckit.specify.prompt.md +0 -3
- package/.github/prompts/speckit.tasks.prompt.md +0 -3
- package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
- package/.github/workflows/publish.yaml +0 -29
- package/.opencode/command/speckit.analyze.md +0 -184
- package/.opencode/command/speckit.checklist.md +0 -294
- package/.opencode/command/speckit.clarify.md +0 -181
- package/.opencode/command/speckit.constitution.md +0 -84
- package/.opencode/command/speckit.implement.md +0 -135
- package/.opencode/command/speckit.plan.md +0 -89
- package/.opencode/command/speckit.specify.md +0 -258
- package/.opencode/command/speckit.tasks.md +0 -137
- package/.opencode/command/speckit.taskstoissues.md +0 -30
- package/.qwen/commands/opsx-apply.toml +0 -149
- package/.qwen/commands/opsx-archive.toml +0 -154
- package/.qwen/commands/opsx-bulk-archive.toml +0 -239
- package/.qwen/commands/opsx-continue.toml +0 -111
- package/.qwen/commands/opsx-explore.toml +0 -171
- package/.qwen/commands/opsx-ff.toml +0 -91
- package/.qwen/commands/opsx-new.toml +0 -66
- package/.qwen/commands/opsx-onboard.toml +0 -522
- package/.qwen/commands/opsx-sync.toml +0 -131
- package/.qwen/commands/opsx-verify.toml +0 -161
- package/.qwen/skills/openspec-apply-change/SKILL.md +0 -156
- package/.qwen/skills/openspec-archive-change/SKILL.md +0 -114
- package/.qwen/skills/openspec-bulk-archive-change/SKILL.md +0 -246
- package/.qwen/skills/openspec-continue-change/SKILL.md +0 -118
- package/.qwen/skills/openspec-explore/SKILL.md +0 -290
- package/.qwen/skills/openspec-ff-change/SKILL.md +0 -101
- package/.qwen/skills/openspec-new-change/SKILL.md +0 -74
- package/.qwen/skills/openspec-onboard/SKILL.md +0 -529
- package/.qwen/skills/openspec-sync-specs/SKILL.md +0 -138
- package/.qwen/skills/openspec-verify-change/SKILL.md +0 -168
- package/.specify/memory/constitution.md +0 -58
- package/.specify/scripts/powershell/check-prerequisites.ps1 +0 -148
- package/.specify/scripts/powershell/common.ps1 +0 -137
- package/.specify/scripts/powershell/create-new-feature.ps1 +0 -283
- package/.specify/scripts/powershell/setup-plan.ps1 +0 -61
- package/.specify/scripts/powershell/update-agent-context.ps1 +0 -448
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/constitution-template.md +0 -50
- package/.specify/templates/plan-template.md +0 -104
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -251
- package/.vscode/launch.json +0 -14
- package/.vscode/settings.json +0 -14
- package/.vscode/tasks.json +0 -15
- package/AGENTS.md +0 -117
- package/CLAUDE.md +0 -70
- package/Dockerfile +0 -30
- package/GEMINI.md +0 -117
- package/QWEN.md +0 -117
- package/docker-compose.yml +0 -15
- package/openapi.yaml +0 -3127
- package/openspec/README.md +0 -33
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/design.md +0 -60
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/proposal.md +0 -25
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/credit-card-transactions/spec.md +0 -46
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/specs/transactions/spec.md +0 -42
- package/openspec/changes/archive/2026-04-03-separate-credit-card-transaction-tools/tasks.md +0 -22
- package/openspec/config.yaml +0 -20
- package/openspec/specs/accounts/spec.md +0 -86
- package/openspec/specs/categories/spec.md +0 -78
- package/openspec/specs/credit-card-transactions/spec.md +0 -64
- package/openspec/specs/credit-cards/spec.md +0 -109
- package/openspec/specs/data/spec.md +0 -49
- package/openspec/specs/settings/spec.md +0 -48
- package/openspec/specs/subscriptions/spec.md +0 -85
- package/openspec/specs/summary/spec.md +0 -49
- package/openspec/specs/transactions/spec.md +0 -113
- package/openspec/specs/transfers/spec.md +0 -74
- package/specs/001-mcp-api-integration/checklists/requirements.md +0 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +0 -636
- package/specs/001-mcp-api-integration/data-model.md +0 -106
- package/specs/001-mcp-api-integration/plan.md +0 -73
- package/specs/001-mcp-api-integration/quickstart.md +0 -74
- package/specs/001-mcp-api-integration/research.md +0 -58
- package/specs/001-mcp-api-integration/spec.md +0 -119
- package/specs/001-mcp-api-integration/tasks.md +0 -64
- package/src/config.ts +0 -39
- package/src/index.ts +0 -99
- package/src/services/apiClient.ts +0 -55
- package/src/services/requestContext.ts +0 -11
- package/src/tools/accounts.ts +0 -122
- package/src/tools/categories.ts +0 -102
- package/src/tools/credit-cards.ts +0 -203
- package/src/tools/data.ts +0 -45
- package/src/tools/settings.ts +0 -64
- package/src/tools/subscriptions.ts +0 -159
- package/src/tools/summary.ts +0 -29
- package/src/tools/transactions.ts +0 -200
- package/src/tools/transfers.ts +0 -122
- package/src/types/schemas.ts +0 -333
- package/src/utils/toolHelpers.ts +0 -11
- package/tests/benchmark.test.d.ts +0 -2
- package/tests/benchmark.test.d.ts.map +0 -1
- package/tests/benchmark.test.js +0 -33
- package/tests/benchmark.test.js.map +0 -1
- package/tests/benchmark.test.ts +0 -38
- package/tests/server.test.d.ts +0 -2
- package/tests/server.test.d.ts.map +0 -1
- package/tests/server.test.js +0 -13
- package/tests/server.test.js.map +0 -1
- package/tests/server.test.ts +0 -14
- package/tests/setup.d.ts +0 -4
- package/tests/setup.d.ts.map +0 -1
- package/tests/setup.js +0 -17
- package/tests/setup.js.map +0 -1
- package/tests/setup.ts +0 -20
- package/tests/tools/accounts.test.ts +0 -159
- package/tests/tools/categories.test.d.ts +0 -2
- package/tests/tools/categories.test.d.ts.map +0 -1
- package/tests/tools/categories.test.js +0 -63
- package/tests/tools/categories.test.js.map +0 -1
- package/tests/tools/categories.test.ts +0 -120
- package/tests/tools/credit-cards.test.d.ts +0 -2
- package/tests/tools/credit-cards.test.d.ts.map +0 -1
- package/tests/tools/credit-cards.test.js +0 -71
- package/tests/tools/credit-cards.test.js.map +0 -1
- package/tests/tools/credit-cards.test.ts +0 -131
- package/tests/tools/data.test.ts +0 -100
- package/tests/tools/settings.test.ts +0 -116
- package/tests/tools/subscriptions.test.ts +0 -173
- package/tests/tools/summary.test.d.ts +0 -2
- package/tests/tools/summary.test.d.ts.map +0 -1
- package/tests/tools/summary.test.js +0 -36
- package/tests/tools/summary.test.js.map +0 -1
- package/tests/tools/summary.test.ts +0 -63
- package/tests/tools/transactions.test.d.ts +0 -2
- package/tests/tools/transactions.test.d.ts.map +0 -1
- package/tests/tools/transactions.test.js +0 -67
- package/tests/tools/transactions.test.js.map +0 -1
- package/tests/tools/transactions.test.ts +0 -133
- package/tests/tools/transfers.test.ts +0 -141
- package/tsconfig.json +0 -52
- package/vitest.config.d.ts +0 -3
- package/vitest.config.d.ts.map +0 -1
- package/vitest.config.js +0 -14
- package/vitest.config.js.map +0 -1
- package/vitest.config.ts +0 -14
package/src/tools/summary.ts
DELETED
|
@@ -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
|
-
}
|
package/src/tools/transfers.ts
DELETED
|
@@ -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
|
-
}
|
package/src/types/schemas.ts
DELETED
|
@@ -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
|
-
});
|