@codemill-solutions/yuki-mcp 1.1.0 → 1.3.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 +94 -16
- package/dist/index.js +56 -12
- package/dist/index.js.map +1 -1
- package/dist/tools/accounting-info.d.ts +19 -0
- package/dist/tools/accounting-info.d.ts.map +1 -0
- package/dist/tools/accounting-info.js +366 -0
- package/dist/tools/accounting-info.js.map +1 -0
- package/dist/tools/accounting.d.ts +6 -0
- package/dist/tools/accounting.d.ts.map +1 -1
- package/dist/tools/accounting.js +122 -1
- package/dist/tools/accounting.js.map +1 -1
- package/dist/tools/administrations.d.ts +10 -0
- package/dist/tools/administrations.d.ts.map +1 -1
- package/dist/tools/administrations.js +46 -0
- package/dist/tools/administrations.js.map +1 -1
- package/dist/tools/backoffice.js +2 -2
- package/dist/tools/backoffice.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +372 -3
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/invoices.js +4 -4
- package/dist/tools/invoices.js.map +1 -1
- package/dist/tools/relations.js +2 -2
- package/dist/tools/relations.js.map +1 -1
- package/dist/tools/transactions.js +3 -3
- package/dist/tools/transactions.js.map +1 -1
- package/dist/yuki-client.d.ts +25 -10
- package/dist/yuki-client.d.ts.map +1 -1
- package/dist/yuki-client.js +74 -19
- package/dist/yuki-client.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Register tools for the Yuki AccountingInfo service.
|
|
4
|
+
*
|
|
5
|
+
* AccountingInfo.asmx provides richer read-only views of accounting data
|
|
6
|
+
* that are not available through the main Accounting.asmx service:
|
|
7
|
+
*
|
|
8
|
+
* - Full GL account scheme (codes, types, subtypes, active/inactive)
|
|
9
|
+
* - Fiscal period table (period names and date ranges per year)
|
|
10
|
+
* - Detailed transaction listing (includes document type, folder, period, project)
|
|
11
|
+
* - Transaction document download (retrieve the source PDF as base64)
|
|
12
|
+
* - Opening balances per GL account per fiscal year
|
|
13
|
+
*
|
|
14
|
+
* Yuki service: AccountingInfo.asmx
|
|
15
|
+
* Note: uses sessionID / administrationID (uppercase D), same as Accounting.asmx.
|
|
16
|
+
*/
|
|
17
|
+
export function registerAccountingInfoTools(server, client) {
|
|
18
|
+
// ── get_gl_account_scheme ────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* get_gl_account_scheme
|
|
21
|
+
*
|
|
22
|
+
* Retrieve the complete GL account scheme (rekeningschema) for an
|
|
23
|
+
* administration: all account codes with their type, subtype, and
|
|
24
|
+
* active/inactive status.
|
|
25
|
+
*
|
|
26
|
+
* Use this instead of get_gl_accounts when you need the full account
|
|
27
|
+
* definition (type, subtype, enabled flag) rather than current balances.
|
|
28
|
+
* Useful for building GL account pickers, validating codes before booking,
|
|
29
|
+
* or understanding the chart-of-accounts structure.
|
|
30
|
+
*
|
|
31
|
+
* Rate cost: 1 request.
|
|
32
|
+
*/
|
|
33
|
+
server.registerTool('get_gl_account_scheme', {
|
|
34
|
+
description: 'Retrieve the complete GL account scheme (rekeningschema) for an administration. ' +
|
|
35
|
+
'Returns every account code with its type, subtype, description, and active/inactive status. ' +
|
|
36
|
+
'Use this to validate GL codes before booking or to build account pickers. ' +
|
|
37
|
+
'For current balances use get_gl_accounts instead.',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
administrationId: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
43
|
+
},
|
|
44
|
+
}, async ({ administrationId }) => {
|
|
45
|
+
try {
|
|
46
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
47
|
+
if (!adminId)
|
|
48
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
49
|
+
const sessionID = await client.getSessionID(adminId);
|
|
50
|
+
const result = await client.callSoap({
|
|
51
|
+
service: 'AccountingInfo.asmx',
|
|
52
|
+
method: 'GetGLAccountScheme',
|
|
53
|
+
params: { sessionID, administrationID: adminId },
|
|
54
|
+
});
|
|
55
|
+
const accounts = normalizeList(result, ['GLAccounts', 'Accounts'], ['GLAccount', 'Account', 'Row']);
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: 'text',
|
|
60
|
+
text: JSON.stringify({ success: true, count: accounts.length, accounts }, null, 2),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
return errorResponse(err);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// ── get_period_table ─────────────────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* get_period_table
|
|
72
|
+
*
|
|
73
|
+
* Retrieve the fiscal period table for a given year: period names, numbers,
|
|
74
|
+
* and the date range each period covers.
|
|
75
|
+
*
|
|
76
|
+
* This is essential for Theun's depreciation and salary reports, which need
|
|
77
|
+
* to display "the last period in which a booking was made" in human-readable
|
|
78
|
+
* form (e.g. "Periode 3 · maart 2025") rather than a raw date.
|
|
79
|
+
*
|
|
80
|
+
* Use the returned period names to annotate gl_balances and
|
|
81
|
+
* workflow_snapshots in the monorepo dashboard.
|
|
82
|
+
*
|
|
83
|
+
* Rate cost: 1 request.
|
|
84
|
+
*/
|
|
85
|
+
server.registerTool('get_period_table', {
|
|
86
|
+
description: 'Retrieve the fiscal period table (periodeoverzicht) for a given fiscal year. ' +
|
|
87
|
+
'Returns period numbers, names, and start/end dates. ' +
|
|
88
|
+
'Use this to translate a transaction date into a period name for reports ' +
|
|
89
|
+
'(e.g. "tot welke periode zijn afschrijvingen verwerkt").',
|
|
90
|
+
inputSchema: {
|
|
91
|
+
yearId: z
|
|
92
|
+
.number()
|
|
93
|
+
.int()
|
|
94
|
+
.describe('Fiscal year as a 4-digit integer (e.g. 2025).'),
|
|
95
|
+
administrationId: z
|
|
96
|
+
.string()
|
|
97
|
+
.optional()
|
|
98
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
99
|
+
},
|
|
100
|
+
}, async ({ yearId, administrationId }) => {
|
|
101
|
+
try {
|
|
102
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
103
|
+
if (!adminId)
|
|
104
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
105
|
+
const sessionID = await client.getSessionID(adminId);
|
|
106
|
+
const result = await client.callSoap({
|
|
107
|
+
service: 'AccountingInfo.asmx',
|
|
108
|
+
method: 'GetPeriodDateTable',
|
|
109
|
+
params: { sessionID, administrationID: adminId, yearID: yearId },
|
|
110
|
+
});
|
|
111
|
+
const periods = normalizeList(result, ['Periods', 'AdministrationPeriods'], ['Period', 'AdministrationPeriod', 'Row']);
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: JSON.stringify({ success: true, yearId, count: periods.length, periods }, null, 2),
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
catch (err) {
|
|
122
|
+
return errorResponse(err);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
// ── get_gl_transactions_detailed ────────────────────────────────────────────
|
|
126
|
+
/**
|
|
127
|
+
* get_gl_transactions_detailed
|
|
128
|
+
*
|
|
129
|
+
* Retrieve a detailed transaction listing for a GL account (or all accounts)
|
|
130
|
+
* within a date range. Returns richer data than get_transactions:
|
|
131
|
+
* document type, archive folder, fiscal period ID, project code,
|
|
132
|
+
* mutation user, and company name.
|
|
133
|
+
*
|
|
134
|
+
* Use this when you need to determine *when* a specific type of booking
|
|
135
|
+
* (e.g. depreciation, salary journal) was last made on an account, or
|
|
136
|
+
* when you need to link a transaction back to its source document.
|
|
137
|
+
*
|
|
138
|
+
* financialMode: '1' = fiscal (default, matches Yuki's fiscal year),
|
|
139
|
+
* '0' = commercial (calendar year).
|
|
140
|
+
*
|
|
141
|
+
* Rate cost: 1 request.
|
|
142
|
+
*/
|
|
143
|
+
server.registerTool('get_gl_transactions_detailed', {
|
|
144
|
+
description: 'Retrieve detailed transaction data for a GL account within a date range. ' +
|
|
145
|
+
'Returns richer fields than get_transactions: document type, archive folder, ' +
|
|
146
|
+
'fiscal period ID, project code, and mutation user. ' +
|
|
147
|
+
'Leave glAccountCode empty to fetch all accounts. ' +
|
|
148
|
+
'Use this to find the last period in which a depreciation or salary booking was made.',
|
|
149
|
+
inputSchema: {
|
|
150
|
+
startDate: z.string().describe('Start date in YYYY-MM-DD format (inclusive)'),
|
|
151
|
+
endDate: z.string().describe('End date in YYYY-MM-DD format (inclusive)'),
|
|
152
|
+
glAccountCode: z
|
|
153
|
+
.string()
|
|
154
|
+
.optional()
|
|
155
|
+
.describe('GL account code to filter (e.g. "0300" for depreciation). Leave empty for all accounts.'),
|
|
156
|
+
financialMode: z
|
|
157
|
+
.enum(['0', '1'])
|
|
158
|
+
.optional()
|
|
159
|
+
.default('1')
|
|
160
|
+
.describe("Financial mode: '1' = fiscal (default), '0' = commercial."),
|
|
161
|
+
administrationId: z
|
|
162
|
+
.string()
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
165
|
+
},
|
|
166
|
+
}, async ({ startDate, endDate, glAccountCode, financialMode, administrationId }) => {
|
|
167
|
+
try {
|
|
168
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
169
|
+
if (!adminId)
|
|
170
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
171
|
+
const sessionID = await client.getSessionID(adminId);
|
|
172
|
+
const result = await client.callSoap({
|
|
173
|
+
service: 'AccountingInfo.asmx',
|
|
174
|
+
method: 'GetTransactionDetails',
|
|
175
|
+
params: {
|
|
176
|
+
sessionID,
|
|
177
|
+
administrationID: adminId,
|
|
178
|
+
GLAccountCode: glAccountCode ?? '',
|
|
179
|
+
StartDate: startDate,
|
|
180
|
+
EndDate: endDate,
|
|
181
|
+
financialMode: financialMode ?? '1',
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
const transactions = normalizeList(result, ['TransactionInfos', 'Transactions'], ['TransactionInfo', 'Transaction', 'Row']);
|
|
185
|
+
return {
|
|
186
|
+
content: [
|
|
187
|
+
{
|
|
188
|
+
type: 'text',
|
|
189
|
+
text: JSON.stringify({
|
|
190
|
+
success: true,
|
|
191
|
+
count: transactions.length,
|
|
192
|
+
period: { startDate, endDate },
|
|
193
|
+
glAccountCode: glAccountCode ?? '(all)',
|
|
194
|
+
financialMode,
|
|
195
|
+
transactions,
|
|
196
|
+
}, null, 2),
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
return errorResponse(err);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// ── get_transaction_document ─────────────────────────────────────────────────
|
|
206
|
+
/**
|
|
207
|
+
* get_transaction_document
|
|
208
|
+
*
|
|
209
|
+
* Download the source document (PDF) associated with a transaction in Yuki,
|
|
210
|
+
* returned as a base64-encoded string.
|
|
211
|
+
*
|
|
212
|
+
* Use the transactionId from a get_gl_transactions_detailed response (the `id`
|
|
213
|
+
* or `hID` field). Useful for retrieving the original invoice PDF from a
|
|
214
|
+
* booked transaction for verification or re-archival.
|
|
215
|
+
*
|
|
216
|
+
* Rate cost: 1 request.
|
|
217
|
+
*/
|
|
218
|
+
server.registerTool('get_transaction_document', {
|
|
219
|
+
description: 'Download the source document (PDF) for a booked transaction, returned as base64. ' +
|
|
220
|
+
'Use the transaction ID from get_gl_transactions_detailed. ' +
|
|
221
|
+
'Returns fileName and base64-encoded fileData.',
|
|
222
|
+
inputSchema: {
|
|
223
|
+
transactionId: z
|
|
224
|
+
.string()
|
|
225
|
+
.describe('Transaction ID (from the id or hID field in get_gl_transactions_detailed).'),
|
|
226
|
+
administrationId: z
|
|
227
|
+
.string()
|
|
228
|
+
.optional()
|
|
229
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
230
|
+
},
|
|
231
|
+
}, async ({ transactionId, administrationId }) => {
|
|
232
|
+
try {
|
|
233
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
234
|
+
if (!adminId)
|
|
235
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
236
|
+
const sessionID = await client.getSessionID(adminId);
|
|
237
|
+
const result = await client.callSoap({
|
|
238
|
+
service: 'AccountingInfo.asmx',
|
|
239
|
+
method: 'GetTransactionDocument',
|
|
240
|
+
params: { sessionID, administrationID: adminId, transactionID: transactionId },
|
|
241
|
+
});
|
|
242
|
+
// Result shape: { fileName: string, filedata: string (base64) }
|
|
243
|
+
const doc = result;
|
|
244
|
+
const fileName = doc['fileName'] ?? doc['FileName'] ?? null;
|
|
245
|
+
const fileData = doc['filedata'] ?? doc['fileData'] ?? doc['FileData'] ?? null;
|
|
246
|
+
return {
|
|
247
|
+
content: [
|
|
248
|
+
{
|
|
249
|
+
type: 'text',
|
|
250
|
+
text: JSON.stringify({
|
|
251
|
+
success: true,
|
|
252
|
+
transactionId,
|
|
253
|
+
fileName,
|
|
254
|
+
fileDataBase64: fileData,
|
|
255
|
+
}, null, 2),
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
return errorResponse(err);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
// ── get_start_balances ───────────────────────────────────────────────────────
|
|
265
|
+
/**
|
|
266
|
+
* get_start_balances
|
|
267
|
+
*
|
|
268
|
+
* Retrieve the opening balances (beginbalansen) per GL account for a
|
|
269
|
+
* specific fiscal year.
|
|
270
|
+
*
|
|
271
|
+
* Use this when building year-over-year comparisons or verifying that
|
|
272
|
+
* opening entries match the closing balances of the prior year.
|
|
273
|
+
*
|
|
274
|
+
* financialMode: '1' = fiscal (default), '0' = commercial.
|
|
275
|
+
*
|
|
276
|
+
* Rate cost: 1 request.
|
|
277
|
+
*/
|
|
278
|
+
server.registerTool('get_start_balances', {
|
|
279
|
+
description: 'Retrieve opening balances (beginbalansen) per GL account for a fiscal year. ' +
|
|
280
|
+
'Returns accountID, accountDescription, and startBalance for each GL account. ' +
|
|
281
|
+
'Use this for year-over-year balance verification.',
|
|
282
|
+
inputSchema: {
|
|
283
|
+
yearId: z
|
|
284
|
+
.number()
|
|
285
|
+
.int()
|
|
286
|
+
.describe('Fiscal year as a 4-digit integer (e.g. 2025).'),
|
|
287
|
+
financialMode: z
|
|
288
|
+
.enum(['0', '1'])
|
|
289
|
+
.optional()
|
|
290
|
+
.default('1')
|
|
291
|
+
.describe("Financial mode: '1' = fiscal (default), '0' = commercial."),
|
|
292
|
+
administrationId: z
|
|
293
|
+
.string()
|
|
294
|
+
.optional()
|
|
295
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
296
|
+
},
|
|
297
|
+
}, async ({ yearId, financialMode, administrationId }) => {
|
|
298
|
+
try {
|
|
299
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
300
|
+
if (!adminId)
|
|
301
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
302
|
+
const sessionID = await client.getSessionID(adminId);
|
|
303
|
+
const result = await client.callSoap({
|
|
304
|
+
service: 'AccountingInfo.asmx',
|
|
305
|
+
method: 'GetStartBalanceByGLAccount',
|
|
306
|
+
params: {
|
|
307
|
+
sessionID,
|
|
308
|
+
administrationID: adminId,
|
|
309
|
+
yearID: yearId,
|
|
310
|
+
financialMode: financialMode ?? '1',
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
const balances = normalizeList(result, ['StartBalances', 'AccountStartBalances'], ['StartBalance', 'AccountStartBalance', 'Row']);
|
|
314
|
+
return {
|
|
315
|
+
content: [
|
|
316
|
+
{
|
|
317
|
+
type: 'text',
|
|
318
|
+
text: JSON.stringify({ success: true, yearId, financialMode, count: balances.length, balances }, null, 2),
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
catch (err) {
|
|
324
|
+
return errorResponse(err);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
// ── Shared helpers ─────────────────────────────────────────────────────────────
|
|
329
|
+
/** Generic list normaliser: tries wrapper tags then item tags, falls back to raw. */
|
|
330
|
+
function normalizeList(result, wrappers, itemTags) {
|
|
331
|
+
if (!result)
|
|
332
|
+
return [];
|
|
333
|
+
if (Array.isArray(result))
|
|
334
|
+
return result;
|
|
335
|
+
const rec = result;
|
|
336
|
+
for (const wrapper of wrappers) {
|
|
337
|
+
const c = rec[wrapper];
|
|
338
|
+
if (!c)
|
|
339
|
+
continue;
|
|
340
|
+
if (Array.isArray(c))
|
|
341
|
+
return c;
|
|
342
|
+
const inner = c;
|
|
343
|
+
for (const tag of itemTags) {
|
|
344
|
+
if (Array.isArray(inner[tag]))
|
|
345
|
+
return inner[tag];
|
|
346
|
+
if (inner[tag])
|
|
347
|
+
return [inner[tag]];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
for (const tag of itemTags) {
|
|
351
|
+
if (Array.isArray(rec[tag]))
|
|
352
|
+
return rec[tag];
|
|
353
|
+
if (rec[tag])
|
|
354
|
+
return [rec[tag]];
|
|
355
|
+
}
|
|
356
|
+
return [result];
|
|
357
|
+
}
|
|
358
|
+
/** Uniform error response shape. */
|
|
359
|
+
function errorResponse(err) {
|
|
360
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
361
|
+
return {
|
|
362
|
+
content: [{ type: 'text', text: JSON.stringify({ success: false, error: message }, null, 2) }],
|
|
363
|
+
isError: true,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=accounting-info.js.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D,IAAI,KAAK,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC,GAAG,CAAc,CAAC;QAC1D,IAAI,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED,oCAAoC;AACpC,SAAS,aAAa,CAAC,GAAY;IACjC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACvG,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -10,4 +10,10 @@ import { YukiClient } from '../yuki-client.js';
|
|
|
10
10
|
* Method: GLAccountBalance(sessionID, administrationID, transactionDate)
|
|
11
11
|
*/
|
|
12
12
|
export declare function registerAccountingTools(server: McpServer, client: YukiClient): void;
|
|
13
|
+
/**
|
|
14
|
+
* Register additional accounting tools (fiscal variants and revenue).
|
|
15
|
+
* Called separately from registerAccountingTools so each can be exported
|
|
16
|
+
* and imported individually if needed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function registerAccountingExtendedTools(server: McpServer, client: YukiClient): void;
|
|
13
19
|
//# sourceMappingURL=accounting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting.d.ts","sourceRoot":"","sources":["../../src/tools/accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"accounting.d.ts","sourceRoot":"","sources":["../../src/tools/accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAoFnF;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CA2I3F"}
|
package/dist/tools/accounting.js
CHANGED
|
@@ -39,7 +39,7 @@ export function registerAccountingTools(server, client) {
|
|
|
39
39
|
if (!adminId) {
|
|
40
40
|
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
41
41
|
}
|
|
42
|
-
const sessionID = await client.getSessionID();
|
|
42
|
+
const sessionID = await client.getSessionID(adminId);
|
|
43
43
|
// Default to today's date in ISO format when not specified
|
|
44
44
|
const transactionDate = date ?? new Date().toISOString().split('T')[0];
|
|
45
45
|
const result = await client.callSoap({
|
|
@@ -80,6 +80,127 @@ export function registerAccountingTools(server, client) {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Register additional accounting tools (fiscal variants and revenue).
|
|
85
|
+
* Called separately from registerAccountingTools so each can be exported
|
|
86
|
+
* and imported individually if needed.
|
|
87
|
+
*/
|
|
88
|
+
export function registerAccountingExtendedTools(server, client) {
|
|
89
|
+
// ── get_gl_accounts_fiscal ─────────────────────────────────────────────────
|
|
90
|
+
/**
|
|
91
|
+
* get_gl_accounts_fiscal
|
|
92
|
+
*
|
|
93
|
+
* Retrieve all GL accounts with their balance at a given date, *including*
|
|
94
|
+
* fiscal corrections (e.g. end-of-year accruals, depreciation entries posted
|
|
95
|
+
* after the commercial year-end).
|
|
96
|
+
*
|
|
97
|
+
* Use this instead of get_gl_accounts when you need a balance that matches
|
|
98
|
+
* Yuki's fiscal reporting view rather than the commercial/operational view.
|
|
99
|
+
*
|
|
100
|
+
* Rate cost: 1 request.
|
|
101
|
+
*/
|
|
102
|
+
server.registerTool('get_gl_accounts_fiscal', {
|
|
103
|
+
description: 'Retrieve all GL accounts with their balance including fiscal corrections (fiscale stand). ' +
|
|
104
|
+
'Use this for balance sheet and P&L views that must match Yuki fiscal reports. ' +
|
|
105
|
+
'For the commercial/operational view use get_gl_accounts instead.',
|
|
106
|
+
inputSchema: {
|
|
107
|
+
date: z
|
|
108
|
+
.string()
|
|
109
|
+
.optional()
|
|
110
|
+
.describe("Date for the balance snapshot in YYYY-MM-DD format. Defaults to today."),
|
|
111
|
+
administrationId: z
|
|
112
|
+
.string()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
115
|
+
},
|
|
116
|
+
}, async ({ date, administrationId }) => {
|
|
117
|
+
try {
|
|
118
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
119
|
+
if (!adminId)
|
|
120
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
121
|
+
const sessionID = await client.getSessionID(adminId);
|
|
122
|
+
const transactionDate = date ?? new Date().toISOString().split('T')[0];
|
|
123
|
+
const result = await client.callSoap({
|
|
124
|
+
service: 'Accounting.asmx',
|
|
125
|
+
method: 'GLAccountBalanceFiscal',
|
|
126
|
+
params: { sessionID, administrationID: adminId, transactionDate },
|
|
127
|
+
});
|
|
128
|
+
const accounts = normalizeGLAccounts(result);
|
|
129
|
+
return {
|
|
130
|
+
content: [
|
|
131
|
+
{
|
|
132
|
+
type: 'text',
|
|
133
|
+
text: JSON.stringify({ success: true, count: accounts.length, balanceDate: transactionDate, fiscal: true, accounts }, null, 2),
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
139
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
140
|
+
return {
|
|
141
|
+
content: [{ type: 'text', text: JSON.stringify({ success: false, error: message }, null, 2) }],
|
|
142
|
+
isError: true,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
// ── get_net_revenue ────────────────────────────────────────────────────────
|
|
147
|
+
/**
|
|
148
|
+
* get_net_revenue
|
|
149
|
+
*
|
|
150
|
+
* Retrieve the net revenue (netto-omzet) for an administration within a
|
|
151
|
+
* date range. Optionally includes fiscal corrections.
|
|
152
|
+
*
|
|
153
|
+
* Use this for revenue dashboards, period comparisons, and quick P&L checks
|
|
154
|
+
* without having to sum individual GL account balances manually.
|
|
155
|
+
*
|
|
156
|
+
* Rate cost: 1 request.
|
|
157
|
+
*/
|
|
158
|
+
server.registerTool('get_net_revenue', {
|
|
159
|
+
description: 'Retrieve net revenue (netto-omzet) for an administration within a date range. ' +
|
|
160
|
+
'Set fiscal=true to include fiscal corrections (matches Yuki fiscal reports).',
|
|
161
|
+
inputSchema: {
|
|
162
|
+
startDate: z.string().describe('Start date in YYYY-MM-DD format (inclusive)'),
|
|
163
|
+
endDate: z.string().describe('End date in YYYY-MM-DD format (inclusive)'),
|
|
164
|
+
fiscal: z
|
|
165
|
+
.boolean()
|
|
166
|
+
.optional()
|
|
167
|
+
.default(false)
|
|
168
|
+
.describe('Include fiscal corrections. Default false (commercial view).'),
|
|
169
|
+
administrationId: z
|
|
170
|
+
.string()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe('Administration ID (GUID). Defaults to YUKI_DOMAIN_ID env var.'),
|
|
173
|
+
},
|
|
174
|
+
}, async ({ startDate, endDate, fiscal, administrationId }) => {
|
|
175
|
+
try {
|
|
176
|
+
const adminId = administrationId ?? client.defaultDomainId;
|
|
177
|
+
if (!adminId)
|
|
178
|
+
throw new Error('administrationId is required (or set YUKI_DOMAIN_ID env var)');
|
|
179
|
+
const sessionID = await client.getSessionID(adminId);
|
|
180
|
+
const method = fiscal ? 'NetRevenueFiscal' : 'NetRevenue';
|
|
181
|
+
const result = await client.callSoap({
|
|
182
|
+
service: 'Accounting.asmx',
|
|
183
|
+
method,
|
|
184
|
+
params: { sessionID, administrationID: adminId, StartDate: startDate, EndDate: endDate },
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
content: [
|
|
188
|
+
{
|
|
189
|
+
type: 'text',
|
|
190
|
+
text: JSON.stringify({ success: true, period: { startDate, endDate }, fiscal: fiscal ?? false, result }, null, 2),
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
197
|
+
return {
|
|
198
|
+
content: [{ type: 'text', text: JSON.stringify({ success: false, error: message }, null, 2) }],
|
|
199
|
+
isError: true,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
83
204
|
/** Unwrap the parsed SOAP GL account balance result into a flat array. */
|
|
84
205
|
function normalizeGLAccounts(result) {
|
|
85
206
|
if (!result)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting.js","sourceRoot":"","sources":["../../src/tools/accounting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"accounting.js","sourceRoot":"","sources":["../../src/tools/accounting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,M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,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC,GAAG,CAAc,CAAC;YAC9D,IAAI,KAAK,CAAC,GAAG,CAAC;gBAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC,GAAG,CAAc,CAAC;QAC1D,IAAI,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -11,4 +11,14 @@ import { YukiClient } from '../yuki-client.js';
|
|
|
11
11
|
* Auth flow: Authenticate(accessKey) → sessionID → Administrations(sessionID)
|
|
12
12
|
*/
|
|
13
13
|
export declare function registerAdministrationTools(server: McpServer, client: YukiClient): void;
|
|
14
|
+
/**
|
|
15
|
+
* get_administration_id
|
|
16
|
+
*
|
|
17
|
+
* Look up an administration's GUID by its exact name.
|
|
18
|
+
* Useful when you know the administration name from the Yuki UI but don't
|
|
19
|
+
* have the GUID — avoids having to call get_administrations and scan the list.
|
|
20
|
+
*
|
|
21
|
+
* Rate cost: 1 request.
|
|
22
|
+
*/
|
|
23
|
+
export declare function registerAdministrationLookupTools(server: McpServer, client: YukiClient): void;
|
|
14
24
|
//# sourceMappingURL=administrations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"administrations.d.ts","sourceRoot":"","sources":["../../src/tools/administrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"administrations.d.ts","sourceRoot":"","sources":["../../src/tools/administrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAqDvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAyC7F"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
/**
|
|
2
3
|
* Register tools related to Yuki administrations.
|
|
3
4
|
*
|
|
@@ -55,6 +56,51 @@ export function registerAdministrationTools(server, client) {
|
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* get_administration_id
|
|
61
|
+
*
|
|
62
|
+
* Look up an administration's GUID by its exact name.
|
|
63
|
+
* Useful when you know the administration name from the Yuki UI but don't
|
|
64
|
+
* have the GUID — avoids having to call get_administrations and scan the list.
|
|
65
|
+
*
|
|
66
|
+
* Rate cost: 1 request.
|
|
67
|
+
*/
|
|
68
|
+
export function registerAdministrationLookupTools(server, client) {
|
|
69
|
+
server.registerTool('get_administration_id', {
|
|
70
|
+
description: 'Look up the GUID of a Yuki administration by its exact name. ' +
|
|
71
|
+
'Use this to resolve an administration name to the ID required by other tools. ' +
|
|
72
|
+
'For a full list of administrations and IDs use get_administrations.',
|
|
73
|
+
inputSchema: {
|
|
74
|
+
administrationName: z
|
|
75
|
+
.string()
|
|
76
|
+
.describe('Exact name of the administration as shown in Yuki (case-sensitive).'),
|
|
77
|
+
},
|
|
78
|
+
}, async ({ administrationName }) => {
|
|
79
|
+
try {
|
|
80
|
+
const sessionID = await client.getSessionID();
|
|
81
|
+
const result = await client.callSoap({
|
|
82
|
+
service: 'Accounting.asmx',
|
|
83
|
+
method: 'AdministrationID',
|
|
84
|
+
params: { sessionID, administrationName },
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: 'text',
|
|
90
|
+
text: JSON.stringify({ success: true, administrationName, administrationId: result }, null, 2),
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
97
|
+
return {
|
|
98
|
+
content: [{ type: 'text', text: JSON.stringify({ success: false, error: message }, null, 2) }],
|
|
99
|
+
isError: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
58
104
|
/** Normalise the parsed SOAP result into a flat array of administration objects. */
|
|
59
105
|
function normalizeAdministrations(result) {
|
|
60
106
|
if (!result)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"administrations.js","sourceRoot":"","sources":["../../src/tools/administrations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"administrations.js","sourceRoot":"","sources":["../../src/tools/administrations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAkB;IAC/E;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,WAAW,EACT,oFAAoF;YACpF,iFAAiF;KACpF,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,sDAAsD;YACtD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;YAE9C,kDAAkD;YAClD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC;gBACnC,OAAO,EAAE,iBAAiB;gBAC1B,MAAM,EAAE,iBAAiB;gBACzB,MAA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