beeswax-mcp 1.4.0 → 1.5.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.
package/README.md CHANGED
@@ -141,6 +141,7 @@ reports the same on demand.
141
141
  | `list_milestones`, `get_milestone` | `/milestones` |
142
142
  | `list_projects`, `get_project` | `/active_account/projects` |
143
143
  | `list_transaction_accounts` | `/active_account/transaction_accounts` |
144
+ | `list_account_transactions` | `/active_account/transaction_accounts/:id/transactions?from=&to=` — one account's posted ledger for a period with opening/running/closing balances (the reconciliation query) |
144
145
  | `list_taxes` | `/active_account/taxes` |
145
146
  | `list_companies` | `/active_account/companies` |
146
147
  | `list_task_files`, `list_task_file_versions` | `/tasks/:id/files` (+ per-file version history) |
package/dist/client.js CHANGED
@@ -84,6 +84,28 @@ export class BeeswaxClient {
84
84
  transactions: body?.transactions ?? [],
85
85
  };
86
86
  }
87
+ // Paginated list whose envelope matters (balances, totals): walks every
88
+ // page, merges the array under rootKey, and keeps the first page's other
89
+ // top-level fields (minus meta).
90
+ async fetchAllWithEnvelope(path, rootKey, params = {}) {
91
+ const perPage = 100;
92
+ let page = 1;
93
+ let totalPages = 1;
94
+ let envelope = null;
95
+ const all = [];
96
+ do {
97
+ const body = await this.request(path, { ...params, page, per_page: perPage });
98
+ if (!envelope) {
99
+ envelope = { ...body };
100
+ delete envelope[rootKey];
101
+ delete envelope.meta;
102
+ }
103
+ all.push(...(body?.[rootKey] ?? []));
104
+ totalPages = Number(body?.meta?.total_pages ?? 1) || 1;
105
+ page += 1;
106
+ } while (page <= totalPages && all.length < 20000);
107
+ return { ...(envelope ?? {}), [rootKey]: all };
108
+ }
87
109
  // Paginated list — walks every page (via meta.total_pages) and returns the
88
110
  // merged array. Capped defensively so a malformed meta can't loop forever.
89
111
  async fetchAll(path, rootKey, params = {}) {
package/dist/tools.js CHANGED
@@ -1291,6 +1291,26 @@ export const TOOLS = [
1291
1291
  bank: args.bank,
1292
1292
  }),
1293
1293
  },
1294
+ {
1295
+ name: "list_account_transactions",
1296
+ description: "The ledger for ONE transaction account over a period — the reconciliation query. Returns every POSTED posting to the account between from and to (inclusive, by document date), oldest first, with the opening balance at `from`, a running balance on each line, the period's debit and credit totals and the closing balance. " +
1297
+ "Drafts, payroll templates, quotes and voided entries never appear, so these figures can be compared directly with a trial balance or a tax-return field. " +
1298
+ "Balances follow the account's classification: asset/expense accounts grow with debits, income/loan/equity accounts with credits. Accrual basis only. " +
1299
+ "Use list_transaction_accounts to find the account id. Requires transaction_accounts:read AND transactions:read.",
1300
+ inputSchema: {
1301
+ type: "object",
1302
+ properties: {
1303
+ transaction_account_id: { type: "integer" },
1304
+ from: { type: "string", description: "Start date (inclusive), e.g. '2025-07-01'. Omit for the beginning of time." },
1305
+ to: { type: "string", description: "End date (inclusive), e.g. '2026-06-30'." },
1306
+ },
1307
+ required: ["transaction_account_id"],
1308
+ },
1309
+ handler: (client, args) => client.fetchAllWithEnvelope(`/active_account/transaction_accounts/${args.transaction_account_id}/transactions`, "transactions", {
1310
+ from: normalizeDate(args.from),
1311
+ to: normalizeDate(args.to),
1312
+ }),
1313
+ },
1294
1314
  {
1295
1315
  name: "list_taxes",
1296
1316
  description: "List the account's tax codes — the ids `sell_tax_id` / `buy_tax_id` on a product, and a document line's tax, have to point at. " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beeswax-mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Official MCP server for Beeswax (beeswaxapp.com) — query invoices, quotes, expenses, payments, journals, time entries, projects, products & services and tax returns from Claude and other MCP clients, and build quotes priced from your catalogue.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://www.beeswaxapp.com/support/mcp-setup",