@energio/holded-mcp 1.0.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/LICENSE +21 -0
- package/README.md +1040 -0
- package/dist/constants.d.ts +60 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +72 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/accounting/account-balances.d.ts +19 -0
- package/dist/schemas/accounting/account-balances.d.ts.map +1 -0
- package/dist/schemas/accounting/account-balances.js +28 -0
- package/dist/schemas/accounting/account-balances.js.map +1 -0
- package/dist/schemas/accounting/accounts.d.ts +49 -0
- package/dist/schemas/accounting/accounts.d.ts.map +1 -0
- package/dist/schemas/accounting/accounts.js +50 -0
- package/dist/schemas/accounting/accounts.js.map +1 -0
- package/dist/schemas/accounting/daily-ledger.d.ts +45 -0
- package/dist/schemas/accounting/daily-ledger.d.ts.map +1 -0
- package/dist/schemas/accounting/daily-ledger.js +57 -0
- package/dist/schemas/accounting/daily-ledger.js.map +1 -0
- package/dist/schemas/common.d.ts +118 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +126 -0
- package/dist/schemas/common.js.map +1 -0
- package/dist/schemas/crm/bookings.d.ts +108 -0
- package/dist/schemas/crm/bookings.d.ts.map +1 -0
- package/dist/schemas/crm/bookings.js +96 -0
- package/dist/schemas/crm/bookings.js.map +1 -0
- package/dist/schemas/crm/events.d.ts +57 -0
- package/dist/schemas/crm/events.d.ts.map +1 -0
- package/dist/schemas/crm/events.js +53 -0
- package/dist/schemas/crm/events.js.map +1 -0
- package/dist/schemas/crm/funnels.d.ts +60 -0
- package/dist/schemas/crm/funnels.d.ts.map +1 -0
- package/dist/schemas/crm/funnels.js +48 -0
- package/dist/schemas/crm/funnels.js.map +1 -0
- package/dist/schemas/crm/leads.d.ts +146 -0
- package/dist/schemas/crm/leads.d.ts.map +1 -0
- package/dist/schemas/crm/leads.js +129 -0
- package/dist/schemas/crm/leads.js.map +1 -0
- package/dist/schemas/invoicing/contacts.d.ts +352 -0
- package/dist/schemas/invoicing/contacts.d.ts.map +1 -0
- package/dist/schemas/invoicing/contacts.js +187 -0
- package/dist/schemas/invoicing/contacts.js.map +1 -0
- package/dist/schemas/invoicing/documents.d.ts +424 -0
- package/dist/schemas/invoicing/documents.d.ts.map +1 -0
- package/dist/schemas/invoicing/documents.js +217 -0
- package/dist/schemas/invoicing/documents.js.map +1 -0
- package/dist/schemas/invoicing/expenses-accounts.d.ts +47 -0
- package/dist/schemas/invoicing/expenses-accounts.d.ts.map +1 -0
- package/dist/schemas/invoicing/expenses-accounts.js +43 -0
- package/dist/schemas/invoicing/expenses-accounts.js.map +1 -0
- package/dist/schemas/invoicing/numbering-series.d.ts +94 -0
- package/dist/schemas/invoicing/numbering-series.d.ts.map +1 -0
- package/dist/schemas/invoicing/numbering-series.js +43 -0
- package/dist/schemas/invoicing/numbering-series.js.map +1 -0
- package/dist/schemas/invoicing/payments.d.ts +50 -0
- package/dist/schemas/invoicing/payments.d.ts.map +1 -0
- package/dist/schemas/invoicing/payments.js +46 -0
- package/dist/schemas/invoicing/payments.js.map +1 -0
- package/dist/schemas/invoicing/products.d.ts +176 -0
- package/dist/schemas/invoicing/products.d.ts.map +1 -0
- package/dist/schemas/invoicing/products.js +149 -0
- package/dist/schemas/invoicing/products.js.map +1 -0
- package/dist/schemas/invoicing/remittances.d.ts +21 -0
- package/dist/schemas/invoicing/remittances.d.ts.map +1 -0
- package/dist/schemas/invoicing/remittances.js +20 -0
- package/dist/schemas/invoicing/remittances.js.map +1 -0
- package/dist/schemas/invoicing/sales-channels.d.ts +45 -0
- package/dist/schemas/invoicing/sales-channels.d.ts.map +1 -0
- package/dist/schemas/invoicing/sales-channels.js +41 -0
- package/dist/schemas/invoicing/sales-channels.js.map +1 -0
- package/dist/schemas/invoicing/services.d.ts +55 -0
- package/dist/schemas/invoicing/services.d.ts.map +1 -0
- package/dist/schemas/invoicing/services.js +51 -0
- package/dist/schemas/invoicing/services.js.map +1 -0
- package/dist/schemas/invoicing/taxes.d.ts +12 -0
- package/dist/schemas/invoicing/taxes.d.ts.map +1 -0
- package/dist/schemas/invoicing/taxes.js +12 -0
- package/dist/schemas/invoicing/taxes.js.map +1 -0
- package/dist/schemas/invoicing/treasury.d.ts +42 -0
- package/dist/schemas/invoicing/treasury.d.ts.map +1 -0
- package/dist/schemas/invoicing/treasury.js +39 -0
- package/dist/schemas/invoicing/treasury.js.map +1 -0
- package/dist/schemas/invoicing/warehouses.d.ts +61 -0
- package/dist/schemas/invoicing/warehouses.d.ts.map +1 -0
- package/dist/schemas/invoicing/warehouses.js +43 -0
- package/dist/schemas/invoicing/warehouses.js.map +1 -0
- package/dist/schemas/projects/projects.d.ts +60 -0
- package/dist/schemas/projects/projects.d.ts.map +1 -0
- package/dist/schemas/projects/projects.js +55 -0
- package/dist/schemas/projects/projects.js.map +1 -0
- package/dist/schemas/projects/tasks.d.ts +68 -0
- package/dist/schemas/projects/tasks.d.ts.map +1 -0
- package/dist/schemas/projects/tasks.js +64 -0
- package/dist/schemas/projects/tasks.js.map +1 -0
- package/dist/schemas/projects/time-tracking.d.ts +80 -0
- package/dist/schemas/projects/time-tracking.d.ts.map +1 -0
- package/dist/schemas/projects/time-tracking.js +75 -0
- package/dist/schemas/projects/time-tracking.js.map +1 -0
- package/dist/schemas/team/employees.d.ts +135 -0
- package/dist/schemas/team/employees.d.ts.map +1 -0
- package/dist/schemas/team/employees.js +144 -0
- package/dist/schemas/team/employees.js.map +1 -0
- package/dist/schemas/team/time-tracking.d.ts +98 -0
- package/dist/schemas/team/time-tracking.d.ts.map +1 -0
- package/dist/schemas/team/time-tracking.js +89 -0
- package/dist/schemas/team/time-tracking.js.map +1 -0
- package/dist/services/api.d.ts +118 -0
- package/dist/services/api.d.ts.map +1 -0
- package/dist/services/api.js +441 -0
- package/dist/services/api.js.map +1 -0
- package/dist/tools/accounting/account-balances.d.ts +44 -0
- package/dist/tools/accounting/account-balances.d.ts.map +1 -0
- package/dist/tools/accounting/account-balances.js +240 -0
- package/dist/tools/accounting/account-balances.js.map +1 -0
- package/dist/tools/accounting/accounts.d.ts +18 -0
- package/dist/tools/accounting/accounts.d.ts.map +1 -0
- package/dist/tools/accounting/accounts.js +131 -0
- package/dist/tools/accounting/accounts.js.map +1 -0
- package/dist/tools/accounting/daily-ledger.d.ts +9 -0
- package/dist/tools/accounting/daily-ledger.d.ts.map +1 -0
- package/dist/tools/accounting/daily-ledger.js +117 -0
- package/dist/tools/accounting/daily-ledger.js.map +1 -0
- package/dist/tools/accounting/index.d.ts +9 -0
- package/dist/tools/accounting/index.d.ts.map +1 -0
- package/dist/tools/accounting/index.js +15 -0
- package/dist/tools/accounting/index.js.map +1 -0
- package/dist/tools/crm/bookings.d.ts +18 -0
- package/dist/tools/crm/bookings.d.ts.map +1 -0
- package/dist/tools/crm/bookings.js +272 -0
- package/dist/tools/crm/bookings.js.map +1 -0
- package/dist/tools/crm/events.d.ts +18 -0
- package/dist/tools/crm/events.d.ts.map +1 -0
- package/dist/tools/crm/events.js +134 -0
- package/dist/tools/crm/events.js.map +1 -0
- package/dist/tools/crm/funnels.d.ts +18 -0
- package/dist/tools/crm/funnels.d.ts.map +1 -0
- package/dist/tools/crm/funnels.js +113 -0
- package/dist/tools/crm/funnels.js.map +1 -0
- package/dist/tools/crm/index.d.ts +9 -0
- package/dist/tools/crm/index.d.ts.map +1 -0
- package/dist/tools/crm/index.js +17 -0
- package/dist/tools/crm/index.js.map +1 -0
- package/dist/tools/crm/leads.d.ts +18 -0
- package/dist/tools/crm/leads.d.ts.map +1 -0
- package/dist/tools/crm/leads.js +519 -0
- package/dist/tools/crm/leads.js.map +1 -0
- package/dist/tools/factory.d.ts +55 -0
- package/dist/tools/factory.d.ts.map +1 -0
- package/dist/tools/factory.js +145 -0
- package/dist/tools/factory.js.map +1 -0
- package/dist/tools/invoicing/contacts.d.ts +26 -0
- package/dist/tools/invoicing/contacts.d.ts.map +1 -0
- package/dist/tools/invoicing/contacts.js +358 -0
- package/dist/tools/invoicing/contacts.js.map +1 -0
- package/dist/tools/invoicing/documents.d.ts +18 -0
- package/dist/tools/invoicing/documents.d.ts.map +1 -0
- package/dist/tools/invoicing/documents.js +578 -0
- package/dist/tools/invoicing/documents.js.map +1 -0
- package/dist/tools/invoicing/expenses-accounts.d.ts +25 -0
- package/dist/tools/invoicing/expenses-accounts.d.ts.map +1 -0
- package/dist/tools/invoicing/expenses-accounts.js +111 -0
- package/dist/tools/invoicing/expenses-accounts.js.map +1 -0
- package/dist/tools/invoicing/index.d.ts +9 -0
- package/dist/tools/invoicing/index.d.ts.map +1 -0
- package/dist/tools/invoicing/index.js +33 -0
- package/dist/tools/invoicing/index.js.map +1 -0
- package/dist/tools/invoicing/numbering-series.d.ts +9 -0
- package/dist/tools/invoicing/numbering-series.d.ts.map +1 -0
- package/dist/tools/invoicing/numbering-series.js +161 -0
- package/dist/tools/invoicing/numbering-series.js.map +1 -0
- package/dist/tools/invoicing/payments.d.ts +18 -0
- package/dist/tools/invoicing/payments.d.ts.map +1 -0
- package/dist/tools/invoicing/payments.js +175 -0
- package/dist/tools/invoicing/payments.js.map +1 -0
- package/dist/tools/invoicing/products.d.ts +18 -0
- package/dist/tools/invoicing/products.d.ts.map +1 -0
- package/dist/tools/invoicing/products.js +389 -0
- package/dist/tools/invoicing/products.js.map +1 -0
- package/dist/tools/invoicing/remittances.d.ts +17 -0
- package/dist/tools/invoicing/remittances.d.ts.map +1 -0
- package/dist/tools/invoicing/remittances.js +76 -0
- package/dist/tools/invoicing/remittances.js.map +1 -0
- package/dist/tools/invoicing/sales-channels.d.ts +24 -0
- package/dist/tools/invoicing/sales-channels.d.ts.map +1 -0
- package/dist/tools/invoicing/sales-channels.js +105 -0
- package/dist/tools/invoicing/sales-channels.js.map +1 -0
- package/dist/tools/invoicing/services.d.ts +29 -0
- package/dist/tools/invoicing/services.d.ts.map +1 -0
- package/dist/tools/invoicing/services.js +124 -0
- package/dist/tools/invoicing/services.js.map +1 -0
- package/dist/tools/invoicing/taxes.d.ts +18 -0
- package/dist/tools/invoicing/taxes.d.ts.map +1 -0
- package/dist/tools/invoicing/taxes.js +58 -0
- package/dist/tools/invoicing/taxes.js.map +1 -0
- package/dist/tools/invoicing/treasury.d.ts +9 -0
- package/dist/tools/invoicing/treasury.d.ts.map +1 -0
- package/dist/tools/invoicing/treasury.js +196 -0
- package/dist/tools/invoicing/treasury.js.map +1 -0
- package/dist/tools/invoicing/warehouses.d.ts +18 -0
- package/dist/tools/invoicing/warehouses.d.ts.map +1 -0
- package/dist/tools/invoicing/warehouses.js +133 -0
- package/dist/tools/invoicing/warehouses.js.map +1 -0
- package/dist/tools/projects/index.d.ts +9 -0
- package/dist/tools/projects/index.d.ts.map +1 -0
- package/dist/tools/projects/index.js +15 -0
- package/dist/tools/projects/index.js.map +1 -0
- package/dist/tools/projects/projects.d.ts +18 -0
- package/dist/tools/projects/projects.d.ts.map +1 -0
- package/dist/tools/projects/projects.js +203 -0
- package/dist/tools/projects/projects.js.map +1 -0
- package/dist/tools/projects/tasks.d.ts +18 -0
- package/dist/tools/projects/tasks.d.ts.map +1 -0
- package/dist/tools/projects/tasks.js +154 -0
- package/dist/tools/projects/tasks.js.map +1 -0
- package/dist/tools/projects/time-tracking.d.ts +14 -0
- package/dist/tools/projects/time-tracking.d.ts.map +1 -0
- package/dist/tools/projects/time-tracking.js +291 -0
- package/dist/tools/projects/time-tracking.js.map +1 -0
- package/dist/tools/team/employees.d.ts +18 -0
- package/dist/tools/team/employees.d.ts.map +1 -0
- package/dist/tools/team/employees.js +149 -0
- package/dist/tools/team/employees.js.map +1 -0
- package/dist/tools/team/index.d.ts +9 -0
- package/dist/tools/team/index.d.ts.map +1 -0
- package/dist/tools/team/index.js +13 -0
- package/dist/tools/team/index.js.map +1 -0
- package/dist/tools/team/time-tracking.d.ts +18 -0
- package/dist/tools/team/time-tracking.d.ts.map +1 -0
- package/dist/tools/team/time-tracking.js +398 -0
- package/dist/tools/team/time-tracking.js.map +1 -0
- package/dist/tools/utilities.d.ts +45 -0
- package/dist/tools/utilities.d.ts.map +1 -0
- package/dist/tools/utilities.js +55 -0
- package/dist/tools/utilities.js.map +1 -0
- package/dist/types.d.ts +640 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account Balances tool for Holded API
|
|
3
|
+
*
|
|
4
|
+
* Computes accurate, date-scoped per-account debit/credit/balance totals
|
|
5
|
+
* by aggregating from individual daily ledger entries with cross-fiscal-year
|
|
6
|
+
* leak filtering.
|
|
7
|
+
*/
|
|
8
|
+
import { makeApiRequest } from "../../services/api.js";
|
|
9
|
+
import { ResponseFormat } from "../../constants.js";
|
|
10
|
+
import { withErrorHandling } from "../utilities.js";
|
|
11
|
+
import { AccountBalancesInputSchema, } from "../../schemas/accounting/account-balances.js";
|
|
12
|
+
/** Maximum entry lines per page returned by the daily ledger API (docs say 500, actual is 250) */
|
|
13
|
+
const LEDGER_PAGE_SIZE = 250;
|
|
14
|
+
/**
|
|
15
|
+
* Fetch all daily ledger entry lines for a date range, auto-paginating.
|
|
16
|
+
*/
|
|
17
|
+
async function fetchAllLedgerEntries(starttmp, endtmp) {
|
|
18
|
+
const allEntries = [];
|
|
19
|
+
let page = 1;
|
|
20
|
+
while (true) {
|
|
21
|
+
const queryParams = { starttmp, endtmp };
|
|
22
|
+
if (page > 1) {
|
|
23
|
+
queryParams.page = page;
|
|
24
|
+
}
|
|
25
|
+
const pageEntries = await makeApiRequest("accounting", "dailyledger", "GET", undefined, queryParams);
|
|
26
|
+
allEntries.push(...pageEntries);
|
|
27
|
+
if (pageEntries.length < LEDGER_PAGE_SIZE) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
page++;
|
|
31
|
+
}
|
|
32
|
+
return { entries: allEntries, pagesFetched: page };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Entry types that legitimately appear at the fiscal year boundary timestamp.
|
|
36
|
+
* Any other type at that timestamp is considered a cross-year leak.
|
|
37
|
+
*/
|
|
38
|
+
const BOUNDARY_SAFE_TYPES = new Set(["opening", "vat_regularization"]);
|
|
39
|
+
/**
|
|
40
|
+
* Filter out cross-fiscal-year leaked entries from daily ledger results.
|
|
41
|
+
*
|
|
42
|
+
* Detection uses two signals:
|
|
43
|
+
* 1. Entries sharing the same timestamp as the opening balance entry are candidates.
|
|
44
|
+
* 2. Candidates are confirmed as leaked if their entryNumber also appears at a
|
|
45
|
+
* different timestamp (duplicate = different fiscal year).
|
|
46
|
+
* 3. Fallback: candidates at the opening timestamp whose type is not "opening" or
|
|
47
|
+
* "vat_regularization" are excluded even without a duplicate entryNumber.
|
|
48
|
+
*
|
|
49
|
+
* Exported for unit testing.
|
|
50
|
+
*/
|
|
51
|
+
export function filterLeakedEntries(entries, includeOpening) {
|
|
52
|
+
if (entries.length === 0) {
|
|
53
|
+
return { filtered: [], leakedCount: 0, openingExcluded: false };
|
|
54
|
+
}
|
|
55
|
+
// Step 1: Find opening entry timestamps
|
|
56
|
+
const openingTimestamps = new Set();
|
|
57
|
+
for (const e of entries) {
|
|
58
|
+
if (e.type === "opening") {
|
|
59
|
+
openingTimestamps.add(e.timestamp);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// No opening entry → no fiscal year boundary in range → no leakage possible
|
|
63
|
+
if (openingTimestamps.size === 0) {
|
|
64
|
+
return { filtered: [...entries], leakedCount: 0, openingExcluded: false };
|
|
65
|
+
}
|
|
66
|
+
// Step 2: Build a map of entryNumber → set of distinct timestamps
|
|
67
|
+
const entryNumberTimestamps = new Map();
|
|
68
|
+
for (const e of entries) {
|
|
69
|
+
let ts = entryNumberTimestamps.get(e.entryNumber);
|
|
70
|
+
if (!ts) {
|
|
71
|
+
ts = new Set();
|
|
72
|
+
entryNumberTimestamps.set(e.entryNumber, ts);
|
|
73
|
+
}
|
|
74
|
+
ts.add(e.timestamp);
|
|
75
|
+
}
|
|
76
|
+
// Step 3: Filter
|
|
77
|
+
let leakedCount = 0;
|
|
78
|
+
let openingExcluded = false;
|
|
79
|
+
const filtered = [];
|
|
80
|
+
for (const e of entries) {
|
|
81
|
+
const atBoundary = openingTimestamps.has(e.timestamp);
|
|
82
|
+
if (!atBoundary) {
|
|
83
|
+
// Not at boundary → always keep
|
|
84
|
+
filtered.push(e);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// At boundary: handle by type
|
|
88
|
+
if (e.type === "opening") {
|
|
89
|
+
if (includeOpening) {
|
|
90
|
+
filtered.push(e);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
openingExcluded = true;
|
|
94
|
+
}
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (BOUNDARY_SAFE_TYPES.has(e.type)) {
|
|
98
|
+
// vat_regularization at boundary is legitimate
|
|
99
|
+
filtered.push(e);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
// Non-safe type at boundary → check for duplicate entryNumber (primary signal)
|
|
103
|
+
const timestamps = entryNumberTimestamps.get(e.entryNumber);
|
|
104
|
+
const hasDuplicate = timestamps.size > 1;
|
|
105
|
+
if (hasDuplicate) {
|
|
106
|
+
// Confirmed leak: same entryNumber exists at a different timestamp
|
|
107
|
+
leakedCount++;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
// Fallback: non-safe type at opening timestamp, no duplicate found.
|
|
111
|
+
// Still exclude — legitimate entries at the exact boundary are limited to safe types.
|
|
112
|
+
leakedCount++;
|
|
113
|
+
}
|
|
114
|
+
// Either way, this entry is excluded (not pushed to filtered)
|
|
115
|
+
}
|
|
116
|
+
return { filtered, leakedCount, openingExcluded };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Aggregate daily ledger entries into per-account debit/credit totals.
|
|
120
|
+
*
|
|
121
|
+
* Exported for unit testing.
|
|
122
|
+
*/
|
|
123
|
+
export function aggregateByAccount(entries) {
|
|
124
|
+
const map = new Map();
|
|
125
|
+
for (const e of entries) {
|
|
126
|
+
let acc = map.get(e.account);
|
|
127
|
+
if (!acc) {
|
|
128
|
+
acc = { debit: 0, credit: 0 };
|
|
129
|
+
map.set(e.account, acc);
|
|
130
|
+
}
|
|
131
|
+
acc.debit += e.debit;
|
|
132
|
+
acc.credit += e.credit;
|
|
133
|
+
}
|
|
134
|
+
return map;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Format account balances as markdown
|
|
138
|
+
*/
|
|
139
|
+
export function formatAccountBalancesMarkdown(accounts) {
|
|
140
|
+
if (!accounts.length) {
|
|
141
|
+
return "No account balances found for the requested period.";
|
|
142
|
+
}
|
|
143
|
+
const lines = [
|
|
144
|
+
"# Account Balances",
|
|
145
|
+
"",
|
|
146
|
+
`Found ${accounts.length} accounts:`,
|
|
147
|
+
"",
|
|
148
|
+
"| Account | Name | Group | Debit | Credit | Balance |",
|
|
149
|
+
"|---------|------|-------|------:|-------:|--------:|",
|
|
150
|
+
];
|
|
151
|
+
for (const a of accounts) {
|
|
152
|
+
lines.push(`| ${a.num} | ${a.name} | ${a.group} | ${a.debit.toFixed(2)} | ${a.credit.toFixed(2)} | ${a.balance.toFixed(2)} |`);
|
|
153
|
+
}
|
|
154
|
+
return lines.join("\n");
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Register the account balances tool.
|
|
158
|
+
*/
|
|
159
|
+
export function registerAccountBalancesTools(server) {
|
|
160
|
+
server.registerTool("holded_accounting_list_account_balances", {
|
|
161
|
+
title: "Holded Accounting Account Balances",
|
|
162
|
+
description: `Compute accurate, date-scoped per-account debit/credit/balance totals.
|
|
163
|
+
|
|
164
|
+
Aggregates from individual daily ledger entries and filters out cross-fiscal-year leakage to produce correct period-scoped balances.
|
|
165
|
+
|
|
166
|
+
Use this tool when you need account totals for a specific period (P&L, trial balance, balance sheet).
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
- starttmp (number): Period start as Unix timestamp (required)
|
|
170
|
+
- endtmp (number): Period end as Unix timestamp (required)
|
|
171
|
+
- account_filter (number[]): Filter to specific account numbers (optional, returns all if omitted)
|
|
172
|
+
- include_opening (boolean): Include opening balance entry in totals (default: false — set true for balance sheet, false for P&L)
|
|
173
|
+
- response_format ('json' | 'markdown'): Output format (default: 'json')
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Per-account debit/credit/balance totals, plus metadata about filtered entries.`,
|
|
177
|
+
inputSchema: AccountBalancesInputSchema,
|
|
178
|
+
annotations: {
|
|
179
|
+
readOnlyHint: true,
|
|
180
|
+
destructiveHint: false,
|
|
181
|
+
idempotentHint: true,
|
|
182
|
+
openWorldHint: true,
|
|
183
|
+
},
|
|
184
|
+
}, withErrorHandling(async (params) => {
|
|
185
|
+
const { starttmp, endtmp, account_filter, include_opening, response_format } = params;
|
|
186
|
+
// 1. Fetch all ledger entries (auto-paginate)
|
|
187
|
+
const { entries, pagesFetched } = await fetchAllLedgerEntries(starttmp, endtmp);
|
|
188
|
+
// 2. Filter leaked entries
|
|
189
|
+
const { filtered, leakedCount, openingExcluded } = filterLeakedEntries(entries, include_opening);
|
|
190
|
+
// 3. Aggregate by account
|
|
191
|
+
const totals = aggregateByAccount(filtered);
|
|
192
|
+
// 4. Enrich with account metadata from list_accounts
|
|
193
|
+
const accountMeta = await makeApiRequest("accounting", "chartofaccounts", "GET", undefined, { starttmp, endtmp, includeEmpty: 0 });
|
|
194
|
+
const metaByNum = new Map();
|
|
195
|
+
for (const a of accountMeta) {
|
|
196
|
+
metaByNum.set(a.num, a);
|
|
197
|
+
}
|
|
198
|
+
// 5. Build result
|
|
199
|
+
let accounts = [];
|
|
200
|
+
for (const [num, { debit, credit }] of totals) {
|
|
201
|
+
const meta = metaByNum.get(num);
|
|
202
|
+
accounts.push({
|
|
203
|
+
num,
|
|
204
|
+
name: meta?.name ?? String(num),
|
|
205
|
+
group: meta?.group ?? "",
|
|
206
|
+
debit: Math.round(debit * 100) / 100,
|
|
207
|
+
credit: Math.round(credit * 100) / 100,
|
|
208
|
+
balance: Math.round((debit - credit) * 100) / 100,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// 6. Apply account filter
|
|
212
|
+
if (account_filter && account_filter.length > 0) {
|
|
213
|
+
const filterSet = new Set(account_filter);
|
|
214
|
+
accounts = accounts.filter((a) => filterSet.has(a.num));
|
|
215
|
+
}
|
|
216
|
+
// Sort by account number
|
|
217
|
+
accounts.sort((a, b) => a.num - b.num);
|
|
218
|
+
const structured = {
|
|
219
|
+
accounts,
|
|
220
|
+
count: accounts.length,
|
|
221
|
+
period: {
|
|
222
|
+
starttmp,
|
|
223
|
+
endtmp,
|
|
224
|
+
},
|
|
225
|
+
filtered_entries: {
|
|
226
|
+
leaked_cross_year: leakedCount,
|
|
227
|
+
opening_balance_excluded: openingExcluded,
|
|
228
|
+
},
|
|
229
|
+
pages_fetched: pagesFetched,
|
|
230
|
+
};
|
|
231
|
+
const textContent = response_format === ResponseFormat.MARKDOWN
|
|
232
|
+
? formatAccountBalancesMarkdown(accounts)
|
|
233
|
+
: JSON.stringify(structured, null, 2);
|
|
234
|
+
return {
|
|
235
|
+
content: [{ type: "text", text: textContent }],
|
|
236
|
+
structuredContent: structured,
|
|
237
|
+
};
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=account-balances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-balances.js","sourceRoot":"","sources":["../../../src/tools/accounting/account-balances.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,iBAAiB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
* Accounting Account tools for Holded API
|
|
3
|
+
*/
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { AccountingAccount } from "../../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Format accounting accounts as markdown
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatAccountingAccountsMarkdown(accounts: AccountingAccount[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format a single accounting account as markdown
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatAccountingAccountMarkdown(account: AccountingAccount): string;
|
|
14
|
+
/**
|
|
15
|
+
* Register all accounting account-related tools
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerAccountTools(server: McpServer): void;
|
|
18
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/tools/accounting/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAUnD;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAiBtF;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAOlF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwF5D"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting Account tools for Holded API
|
|
3
|
+
*/
|
|
4
|
+
import { ListAccountingAccountsInputSchema, CreateAccountInputSchema, GetAccountInputSchema, UpdateAccountInputSchema, DeleteAccountInputSchema, } from "../../schemas/accounting/accounts.js";
|
|
5
|
+
import { registerCrudTools } from "../factory.js";
|
|
6
|
+
/**
|
|
7
|
+
* Format accounting accounts as markdown
|
|
8
|
+
*/
|
|
9
|
+
export function formatAccountingAccountsMarkdown(accounts) {
|
|
10
|
+
if (!accounts.length) {
|
|
11
|
+
return "No accounting accounts found.";
|
|
12
|
+
}
|
|
13
|
+
const lines = ["# Accounting Accounts", "", `Found ${accounts.length} accounts:`, ""];
|
|
14
|
+
for (const account of accounts) {
|
|
15
|
+
lines.push(`## ${account.name}`);
|
|
16
|
+
lines.push(`- **ID**: ${account.id}`);
|
|
17
|
+
lines.push(`- **Code**: ${account.code}`);
|
|
18
|
+
if (account.type)
|
|
19
|
+
lines.push(`- **Type**: ${account.type}`);
|
|
20
|
+
if (account.parentId)
|
|
21
|
+
lines.push(`- **Parent ID**: ${account.parentId}`);
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
24
|
+
return lines.join("\n");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Format a single accounting account as markdown
|
|
28
|
+
*/
|
|
29
|
+
export function formatAccountingAccountMarkdown(account) {
|
|
30
|
+
const lines = [`# ${account.name}`, "", `**ID**: ${account.id}`, ""];
|
|
31
|
+
lines.push(`- **Code**: ${account.code}`);
|
|
32
|
+
if (account.type)
|
|
33
|
+
lines.push(`- **Type**: ${account.type}`);
|
|
34
|
+
if (account.parentId)
|
|
35
|
+
lines.push(`- **Parent ID**: ${account.parentId}`);
|
|
36
|
+
return lines.join("\n");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Register all accounting account-related tools
|
|
40
|
+
*/
|
|
41
|
+
export function registerAccountTools(server) {
|
|
42
|
+
registerCrudTools(server, {
|
|
43
|
+
module: "accounting",
|
|
44
|
+
toolPrefix: "holded_accounting",
|
|
45
|
+
resource: "account",
|
|
46
|
+
resourcePlural: "accounts",
|
|
47
|
+
endpoint: "account",
|
|
48
|
+
listEndpoint: "chartofaccounts",
|
|
49
|
+
idParam: "account_id",
|
|
50
|
+
schemas: {
|
|
51
|
+
list: ListAccountingAccountsInputSchema,
|
|
52
|
+
get: GetAccountInputSchema,
|
|
53
|
+
create: CreateAccountInputSchema,
|
|
54
|
+
update: UpdateAccountInputSchema,
|
|
55
|
+
delete: DeleteAccountInputSchema,
|
|
56
|
+
},
|
|
57
|
+
titles: {
|
|
58
|
+
list: "List Holded Accounting Accounts",
|
|
59
|
+
get: "Get Holded Accounting Account",
|
|
60
|
+
create: "Create Holded Accounting Account",
|
|
61
|
+
update: "Update Holded Accounting Account",
|
|
62
|
+
delete: "Delete Holded Accounting Account",
|
|
63
|
+
},
|
|
64
|
+
descriptions: {
|
|
65
|
+
list: `List all accounting accounts (chart of accounts/PGC accounts) from Holded.
|
|
66
|
+
|
|
67
|
+
Returns paginated list of accounting accounts. Use page parameter to navigate through results.
|
|
68
|
+
|
|
69
|
+
For date-scoped account balances (debit/credit/balance totals for a specific period), use holded_accounting_list_account_balances instead.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
- page (number): Page number for pagination (default: 1, max 500 items per page)
|
|
73
|
+
- response_format ('json' | 'markdown'): Output format (default: 'json')
|
|
74
|
+
- include_empty (boolean): Include empty accounts in the results (default: true)
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
Array of accounting accounts with id, code, name, type, and parent account information.`,
|
|
78
|
+
get: `Get a specific accounting account by ID from Holded.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
- account_id (string): The accounting account ID to retrieve (required)
|
|
82
|
+
- response_format ('json' | 'markdown'): Output format (default: 'json')
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Accounting account details including code, name, type, and parent account.`,
|
|
86
|
+
create: `Create a new accounting account in Holded.
|
|
87
|
+
|
|
88
|
+
The prefix parameter takes a 4-digit integer that matches the prefix of the corresponding account in Holded.
|
|
89
|
+
The API will create an account at the next available number under this prefix.
|
|
90
|
+
|
|
91
|
+
Example: 7000 -> 70000001 (Sales)
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
- prefix (number): 4-digit prefix for the account code (required, e.g., 7000 for sales)
|
|
95
|
+
- name (string): Account name (uses parent account name if not provided)
|
|
96
|
+
- color (string): Account color as hex code (e.g., #FF0000)
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
The created accounting account with its assigned code.`,
|
|
100
|
+
update: `Update an existing accounting account in Holded.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
- account_id (string): The accounting account ID to update (required)
|
|
104
|
+
- name (string): Account name
|
|
105
|
+
- code (string): Account code
|
|
106
|
+
- type (string): Account type
|
|
107
|
+
- parentId (string): Parent account ID
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
The updated accounting account.`,
|
|
111
|
+
delete: `Delete an accounting account from Holded.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
- account_id (string): The accounting account ID to delete (required)
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
Confirmation of deletion.`,
|
|
118
|
+
},
|
|
119
|
+
formatters: {
|
|
120
|
+
list: formatAccountingAccountsMarkdown,
|
|
121
|
+
single: formatAccountingAccountMarkdown,
|
|
122
|
+
},
|
|
123
|
+
listQueryParams: (params) => {
|
|
124
|
+
const qp = {};
|
|
125
|
+
if (params.include_empty !== undefined)
|
|
126
|
+
qp.includeEmpty = params.include_empty ? 1 : 0;
|
|
127
|
+
return qp;
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/tools/accounting/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,iCAAiC,EACjC,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAAC,QA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AC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daily Ledger tools for Holded API
|
|
3
|
+
*/
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
/**
|
|
6
|
+
* Register all daily ledger-related tools
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerDailyLedgerTools(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=daily-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daily-ledger.d.ts","sourceRoot":"","sources":["../../../src/tools/accounting/daily-ledger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYpE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8HhE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daily Ledger tools for Holded API
|
|
3
|
+
*/
|
|
4
|
+
import { makeApiRequest, toStructuredContent } from "../../services/api.js";
|
|
5
|
+
import { ResponseFormat } from "../../constants.js";
|
|
6
|
+
import { withErrorHandling } from "../utilities.js";
|
|
7
|
+
import { ListDailyLedgerInputSchema, CreateEntryInputSchema, } from "../../schemas/accounting/daily-ledger.js";
|
|
8
|
+
/**
|
|
9
|
+
* Register all daily ledger-related tools
|
|
10
|
+
*/
|
|
11
|
+
export function registerDailyLedgerTools(server) {
|
|
12
|
+
// List Daily Ledger Entries
|
|
13
|
+
server.registerTool("holded_accounting_list_daily_ledger", {
|
|
14
|
+
title: "List Holded Daily Ledger Entries",
|
|
15
|
+
description: `List daily ledger entries from Holded Accounting.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
- starttmp (number): Starting timestamp as Unix timestamp (required, filters entries from this date)
|
|
19
|
+
- endtmp (number): Ending timestamp as Unix timestamp (required, filters entries until this date)
|
|
20
|
+
- page (number): Page number for pagination (default: 1, max 500 items per page)
|
|
21
|
+
- response_format ('json' | 'markdown'): Output format (default: 'json')
|
|
22
|
+
|
|
23
|
+
Note: The starttmp and endtmp parameters are required by the API. Results may include entries belonging to adjacent fiscal years whose timestamps fall near the period boundary. Pagination order is non-deterministic.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
Array of daily ledger entries with date, account, amount, and description.`,
|
|
27
|
+
inputSchema: ListDailyLedgerInputSchema,
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: true,
|
|
30
|
+
destructiveHint: false,
|
|
31
|
+
idempotentHint: true,
|
|
32
|
+
openWorldHint: true,
|
|
33
|
+
},
|
|
34
|
+
}, withErrorHandling(async (params) => {
|
|
35
|
+
const { starttmp, endtmp, page, response_format } = params;
|
|
36
|
+
const queryParams = {
|
|
37
|
+
starttmp,
|
|
38
|
+
endtmp,
|
|
39
|
+
};
|
|
40
|
+
if (page > 1) {
|
|
41
|
+
queryParams.page = page;
|
|
42
|
+
}
|
|
43
|
+
const entries = await makeApiRequest("accounting", "dailyledger", "GET", undefined, queryParams);
|
|
44
|
+
let textContent;
|
|
45
|
+
if (response_format === ResponseFormat.MARKDOWN) {
|
|
46
|
+
if (!entries.length) {
|
|
47
|
+
textContent = "No daily ledger entries found.";
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const lines = ["# Daily Ledger Entries", "", `Found ${entries.length} entries:`, ""];
|
|
51
|
+
for (const entry of entries) {
|
|
52
|
+
lines.push(`## Entry ${entry.id}`);
|
|
53
|
+
lines.push(`- **ID**: ${entry.id}`);
|
|
54
|
+
lines.push(`- **Date**: ${new Date(entry.date * 1000).toLocaleDateString()}`);
|
|
55
|
+
lines.push(`- **Account**: ${entry.account}`);
|
|
56
|
+
lines.push(`- **Amount**: ${entry.amount}`);
|
|
57
|
+
if (entry.description)
|
|
58
|
+
lines.push(`- **Description**: ${entry.description}`);
|
|
59
|
+
lines.push("");
|
|
60
|
+
}
|
|
61
|
+
textContent = lines.join("\n");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
textContent = JSON.stringify(entries, null, 2);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
content: [{ type: "text", text: textContent }],
|
|
69
|
+
structuredContent: { entries, count: entries.length, page },
|
|
70
|
+
};
|
|
71
|
+
}));
|
|
72
|
+
// Create Daily Ledger Entry
|
|
73
|
+
server.registerTool("holded_accounting_create_entry", {
|
|
74
|
+
title: "Create Holded Daily Ledger Entry",
|
|
75
|
+
description: `Create a new daily ledger entry in Holded Accounting.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
- date (number): Entry date as Unix timestamp (required)
|
|
79
|
+
- lines (array): Array of entry lines, minimum 2 lines required (required)
|
|
80
|
+
Each line object contains:
|
|
81
|
+
- account (number): Accounting account number as integer (required)
|
|
82
|
+
- debit (number): Debit amount (optional, cannot have both debit and credit)
|
|
83
|
+
- credit (number): Credit amount (optional, cannot have both debit and credit)
|
|
84
|
+
- description (string): Line description (optional)
|
|
85
|
+
- tags (array): Array of tags for this entry line (optional)
|
|
86
|
+
- notes (string): Entry note (optional)
|
|
87
|
+
|
|
88
|
+
Requirements:
|
|
89
|
+
- At least 2 entry lines are required
|
|
90
|
+
- Each line must have either debit or credit (not both)
|
|
91
|
+
- Total debits must equal total credits
|
|
92
|
+
- Account numbers must match existing accounting accounts
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
The created daily ledger entry with its assigned ID.`,
|
|
96
|
+
inputSchema: CreateEntryInputSchema,
|
|
97
|
+
annotations: {
|
|
98
|
+
readOnlyHint: false,
|
|
99
|
+
destructiveHint: false,
|
|
100
|
+
idempotentHint: false,
|
|
101
|
+
openWorldHint: true,
|
|
102
|
+
},
|
|
103
|
+
}, withErrorHandling(async (params) => {
|
|
104
|
+
const typedParams = params;
|
|
105
|
+
const response = await makeApiRequest("accounting", "entry", "POST", typedParams);
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: `Daily ledger entry created successfully.\n\n${JSON.stringify(response, null, 2)}`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
structuredContent: toStructuredContent(response),
|
|
114
|
+
};
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=daily-ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daily-ledger.js","sourceRoot":"","sources":["../../../src/tools/accounting/daily-ledger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAGvB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,4BAA4B;IAC5B,MAAM,CAAC,YAAY,CACjB,qCAAqC,EACrC;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE;;;;;;;;;;;6EAW0D;QACvE,WAAW,EAAE,0BAA0B;QACvC,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACjC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAyC,CAAC;QAC9F,MAAM,WAAW,GAA4B;YAC3C,QAAQ;YACR,MAAM;SACP,CAAC;QACF,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;YACb,WAAW,CAAC,IAA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AAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjD,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;YAC9C,iBAAiB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE;SAC5D,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,4BAA4B;IAC5B,MAAM,CAAC,YAAY,CACjB,gCAAgC,EAChC;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;uDAoBoC;QACjD,WAAW,EAAE,sBAAsB;QACnC,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,IAAI;SACpB;KACF,EACD,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACjC,MAAM,WAAW,GAAG,MAAqC,CAAC;QAC1D,MAAM,QAAQ,GAAG,MAAM,cAAc,CACnC,YAAY,EACZ,OAAO,EACP,MAAM,EACN,WAAW,CACZ,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,+CAA+C,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;iBACzF;aACF;YACD,iBAAiB,EAAE,mBAAmB,CAAC,QAAQ,CAAC;SACjD,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting module tools registration
|
|
3
|
+
*/
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
/**
|
|
6
|
+
* Register all accounting-related tools
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerAccountingTools(server: McpServer): void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/accounting/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAI/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting module tools registration
|
|
3
|
+
*/
|
|
4
|
+
import { registerAccountTools } from "./accounts.js";
|
|
5
|
+
import { registerDailyLedgerTools } from "./daily-ledger.js";
|
|
6
|
+
import { registerAccountBalancesTools } from "./account-balances.js";
|
|
7
|
+
/**
|
|
8
|
+
* Register all accounting-related tools
|
|
9
|
+
*/
|
|
10
|
+
export function registerAccountingTools(server) {
|
|
11
|
+
registerAccountTools(server);
|
|
12
|
+
registerDailyLedgerTools(server);
|
|
13
|
+
registerAccountBalancesTools(server);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/accounting/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAiB;IACvD,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC7B,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Booking tools for Holded API
|
|
3
|
+
*/
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { Booking } from "../../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Format bookings as markdown
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatBookingsMarkdown(bookings: Booking[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format a single booking as markdown
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatBookingMarkdown(booking: Booking): string;
|
|
14
|
+
/**
|
|
15
|
+
* Register all booking-related tools
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerBookingTools(server: McpServer): void;
|
|
18
|
+
//# sourceMappingURL=bookings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings.d.ts","sourceRoot":"","sources":["../../../src/tools/crm/bookings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,OAAO,EAAkC,MAAM,gBAAgB,CAAC;AAezE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CA0BlE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAsC9D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6M5D"}
|