UNPKG

@baruchiro/actual-mcp

Version:

Actual Budget MCP server exposing API functionality

24 lines 1.17 kB
// Fetches accounts, categories, groups, and transactions for spending-by-category tool import { fetchAllAccounts } from '../../core/data/fetch-accounts.js'; import { fetchAllCategories, fetchAllCategoryGroups } from '../../core/data/fetch-categories.js'; import { fetchTransactionsForAccount, fetchAllOnBudgetTransactions } from '../../core/data/fetch-transactions.js'; export class SpendingByCategoryDataFetcher { /** * Fetch all required data for the spending-by-category tool. * If accountId is provided, only fetch transactions for that account. */ async fetchAll(accountId, start, end) { const accounts = await fetchAllAccounts(); const categories = await fetchAllCategories(); const categoryGroups = await fetchAllCategoryGroups(); let transactions = []; if (accountId) { transactions = await fetchTransactionsForAccount(accountId, start, end); } else { transactions = await fetchAllOnBudgetTransactions(accounts, start, end); } return { accounts, categories, categoryGroups, transactions }; } } //# sourceMappingURL=data-fetcher.js.map