actual-mcp-server 0.5.6 → 0.5.7
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
CHANGED
package/dist/package.json
CHANGED
|
@@ -22,7 +22,7 @@ const InputSchema = z.object({
|
|
|
22
22
|
});
|
|
23
23
|
const tool = {
|
|
24
24
|
name: 'actual_transactions_uncategorized',
|
|
25
|
-
description: 'List uncategorized transactions (category is null/unset).
|
|
25
|
+
description: 'List uncategorized transactions (category is null/unset). Excludes transfers, split-transaction parents, opening balance entries, off-budget accounts, and closed accounts — matching Actual Budget\'s own Uncategorized view. Defaults to the current month unless a date range is provided. Returns { transactions, count, summary: { totalAmount }, dateRange }.',
|
|
26
26
|
inputSchema: InputSchema,
|
|
27
27
|
call: async (args, _meta) => {
|
|
28
28
|
const input = InputSchema.parse(args || {});
|
|
@@ -38,17 +38,21 @@ const tool = {
|
|
|
38
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
39
|
const txnRaw = await adapter.getTransactions(accountId, startDate, endDate);
|
|
40
40
|
const txns = Array.isArray(txnRaw) ? txnRaw : [];
|
|
41
|
-
// Fetch accounts to build off-budget
|
|
41
|
+
// Fetch accounts to build exclusion set: off-budget + closed accounts.
|
|
42
42
|
const accounts = await adapter.getAccounts();
|
|
43
|
-
const
|
|
43
|
+
const excludedAccountIds = new Set(
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
45
|
(Array.isArray(accounts) ? accounts : [])
|
|
46
|
-
.filter((acc) => acc?.offbudget === true)
|
|
46
|
+
.filter((acc) => acc?.offbudget === true || acc?.closed === true)
|
|
47
47
|
.map((acc) => acc.id));
|
|
48
48
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
49
|
const uncategorized = txns.filter(
|
|
50
50
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
-
(txn) => txn?.category == null &&
|
|
51
|
+
(txn) => txn?.category == null &&
|
|
52
|
+
txn?.transfer_id == null &&
|
|
53
|
+
txn?.is_parent !== true &&
|
|
54
|
+
txn?.starting_balance_flag !== true &&
|
|
55
|
+
!excludedAccountIds.has(txn?.account));
|
|
52
56
|
const limited = uncategorized.slice(0, input.limit ?? 500);
|
|
53
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
58
|
const totalAmount = limited.reduce((sum, txn) => {
|