@frihet/mcp-server 1.6.1 → 1.9.0-beta.1
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 +19 -6
- package/dist/__tests__/banking-tools.test.d.ts +18 -0
- package/dist/__tests__/banking-tools.test.d.ts.map +1 -0
- package/dist/__tests__/banking-tools.test.js +252 -0
- package/dist/__tests__/banking-tools.test.js.map +1 -0
- package/dist/__tests__/einvoice-integration.test.d.ts +24 -0
- package/dist/__tests__/einvoice-integration.test.d.ts.map +1 -0
- package/dist/__tests__/einvoice-integration.test.js +142 -0
- package/dist/__tests__/einvoice-integration.test.js.map +1 -0
- package/dist/__tests__/einvoice-tools.test.d.ts +16 -0
- package/dist/__tests__/einvoice-tools.test.d.ts.map +1 -0
- package/dist/__tests__/einvoice-tools.test.js +435 -0
- package/dist/__tests__/einvoice-tools.test.js.map +1 -0
- package/dist/__tests__/fiscal-tools.test.d.ts +20 -0
- package/dist/__tests__/fiscal-tools.test.d.ts.map +1 -0
- package/dist/__tests__/fiscal-tools.test.js +233 -0
- package/dist/__tests__/fiscal-tools.test.js.map +1 -0
- package/dist/__tests__/pos-tools.test.d.ts +16 -0
- package/dist/__tests__/pos-tools.test.d.ts.map +1 -0
- package/dist/__tests__/pos-tools.test.js +244 -0
- package/dist/__tests__/pos-tools.test.js.map +1 -0
- package/dist/__tests__/recurring-tools.test.d.ts +16 -0
- package/dist/__tests__/recurring-tools.test.d.ts.map +1 -0
- package/dist/__tests__/recurring-tools.test.js +166 -0
- package/dist/__tests__/recurring-tools.test.js.map +1 -0
- package/dist/__tests__/stay-tools.test.d.ts +17 -0
- package/dist/__tests__/stay-tools.test.d.ts.map +1 -0
- package/dist/__tests__/stay-tools.test.js +259 -0
- package/dist/__tests__/stay-tools.test.js.map +1 -0
- package/dist/__tests__/time-tools.test.d.ts +17 -0
- package/dist/__tests__/time-tools.test.d.ts.map +1 -0
- package/dist/__tests__/time-tools.test.js +199 -0
- package/dist/__tests__/time-tools.test.js.map +1 -0
- package/dist/client-interface.d.ts +131 -0
- package/dist/client-interface.d.ts.map +1 -1
- package/dist/client.d.ts +131 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +159 -0
- package/dist/client.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/tools/banking.d.ts +19 -0
- package/dist/tools/banking.d.ts.map +1 -0
- package/dist/tools/banking.js +155 -0
- package/dist/tools/banking.js.map +1 -0
- package/dist/tools/einvoice.d.ts +92 -0
- package/dist/tools/einvoice.d.ts.map +1 -0
- package/dist/tools/einvoice.js +400 -0
- package/dist/tools/einvoice.js.map +1 -0
- package/dist/tools/fiscal.d.ts +22 -0
- package/dist/tools/fiscal.d.ts.map +1 -0
- package/dist/tools/fiscal.js +215 -0
- package/dist/tools/fiscal.js.map +1 -0
- package/dist/tools/pos.d.ts +15 -0
- package/dist/tools/pos.d.ts.map +1 -0
- package/dist/tools/pos.js +156 -0
- package/dist/tools/pos.js.map +1 -0
- package/dist/tools/recurring.d.ts +16 -0
- package/dist/tools/recurring.d.ts.map +1 -0
- package/dist/tools/recurring.js +67 -0
- package/dist/tools/recurring.js.map +1 -0
- package/dist/tools/register-all.d.ts +2 -2
- package/dist/tools/register-all.d.ts.map +1 -1
- package/dist/tools/register-all.js +16 -2
- package/dist/tools/register-all.js.map +1 -1
- package/dist/tools/shared.d.ts +169 -0
- package/dist/tools/shared.d.ts.map +1 -1
- package/dist/tools/shared.js +140 -0
- package/dist/tools/shared.js.map +1 -1
- package/dist/tools/stay.d.ts +6 -78
- package/dist/tools/stay.d.ts.map +1 -1
- package/dist/tools/stay.js +121 -343
- package/dist/tools/stay.js.map +1 -1
- package/dist/tools/time.d.ts +18 -0
- package/dist/tools/time.d.ts.map +1 -0
- package/dist/tools/time.js +134 -0
- package/dist/tools/time.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fiscal tools for the Frihet MCP server — Wave 6 (8 tools).
|
|
3
|
+
*
|
|
4
|
+
* Tools:
|
|
5
|
+
* 1. get_modelo_303_summary — IVA quarterly Spain
|
|
6
|
+
* 2. get_modelo_130_summary — IRPF estimated payment Spain
|
|
7
|
+
* 3. get_modelo_390_summary — IVA annual recap Spain
|
|
8
|
+
* 4. get_modelo_180_summary — IRPF rentals annual Spain
|
|
9
|
+
* 5. get_modelo_347_summary — Operations >€3005 annual third-party recap
|
|
10
|
+
* 6. verifactu_status — VeriFactu submission status for an invoice
|
|
11
|
+
* 7. verifactu_resubmit — Re-submit a failed VeriFactu submission (TRUST AREA)
|
|
12
|
+
* 8. ticketbai_status — Basque Country e-invoicing status
|
|
13
|
+
*
|
|
14
|
+
* REST surface: /v1/fiscal/* (documented: pending — backend ships separately)
|
|
15
|
+
*
|
|
16
|
+
* NOTE: ERP backend endpoints /v1/fiscal/* are planned. Tools are wired
|
|
17
|
+
* and will surface 404 errors until the backend ships.
|
|
18
|
+
*/
|
|
19
|
+
import { z } from "zod/v4";
|
|
20
|
+
import { withToolLogging, formatRecord, getContent, mutateContent, READ_ONLY_ANNOTATIONS, fiscalModeloSummaryOutput, verifactuStatusOutput, ticketbaiStatusOutput, } from "./shared.js";
|
|
21
|
+
export function registerFiscalTools(server, client) {
|
|
22
|
+
// -- get_modelo_303_summary --
|
|
23
|
+
server.registerTool("get_modelo_303_summary", {
|
|
24
|
+
title: "Get Modelo 303 Summary (IVA Quarterly)",
|
|
25
|
+
description: "Get IVA (VAT) quarterly summary for Modelo 303 filing in Spain. " +
|
|
26
|
+
"Returns aggregated totals by tax rate, deductible IVA, net amount due, and filing deadline. " +
|
|
27
|
+
"Example: period='2026-Q1' / " +
|
|
28
|
+
"Obtiene el resumen trimestral del IVA para el Modelo 303 en Espana. " +
|
|
29
|
+
"Devuelve totales por tipo impositivo, IVA deducible, cuota a ingresar y plazo.",
|
|
30
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
31
|
+
inputSchema: {
|
|
32
|
+
period: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Period in format YYYY-QN (e.g. '2026-Q1') or YYYY for annual / Periodo en formato YYYY-QN o YYYY"),
|
|
36
|
+
},
|
|
37
|
+
outputSchema: fiscalModeloSummaryOutput,
|
|
38
|
+
}, async ({ period }) => withToolLogging("get_modelo_303_summary", async () => {
|
|
39
|
+
const result = await client.getFiscalModeloSummary("303", period);
|
|
40
|
+
return {
|
|
41
|
+
content: [getContent(formatRecord("Modelo 303 Summary", result))],
|
|
42
|
+
structuredContent: result,
|
|
43
|
+
};
|
|
44
|
+
}));
|
|
45
|
+
// -- get_modelo_130_summary --
|
|
46
|
+
server.registerTool("get_modelo_130_summary", {
|
|
47
|
+
title: "Get Modelo 130 Summary (IRPF Estimated Payment)",
|
|
48
|
+
description: "Get IRPF estimated payment summary for Modelo 130 filing (freelancers/self-employed in Spain). " +
|
|
49
|
+
"Returns quarterly net income, deductible expenses, previous payments, and amount due. " +
|
|
50
|
+
"Example: period='2026-Q1' / " +
|
|
51
|
+
"Obtiene el resumen del pago fraccionado IRPF para el Modelo 130 (autonomos). " +
|
|
52
|
+
"Devuelve rendimiento neto, gastos deducibles, pagos previos y cuota a ingresar.",
|
|
53
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
54
|
+
inputSchema: {
|
|
55
|
+
period: z
|
|
56
|
+
.string()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("Period in format YYYY-QN (e.g. '2026-Q1') / Periodo en formato YYYY-QN"),
|
|
59
|
+
},
|
|
60
|
+
outputSchema: fiscalModeloSummaryOutput,
|
|
61
|
+
}, async ({ period }) => withToolLogging("get_modelo_130_summary", async () => {
|
|
62
|
+
const result = await client.getFiscalModeloSummary("130", period);
|
|
63
|
+
return {
|
|
64
|
+
content: [getContent(formatRecord("Modelo 130 Summary", result))],
|
|
65
|
+
structuredContent: result,
|
|
66
|
+
};
|
|
67
|
+
}));
|
|
68
|
+
// -- get_modelo_390_summary --
|
|
69
|
+
server.registerTool("get_modelo_390_summary", {
|
|
70
|
+
title: "Get Modelo 390 Summary (IVA Annual Recap)",
|
|
71
|
+
description: "Get IVA annual summary for Modelo 390 filing in Spain. " +
|
|
72
|
+
"Returns full-year totals by rate, total deductible IVA, and annual balance. " +
|
|
73
|
+
"Example: period='2025' / " +
|
|
74
|
+
"Obtiene el resumen anual del IVA para el Modelo 390. " +
|
|
75
|
+
"Devuelve totales anuales por tipo, IVA deducible total y resultado anual.",
|
|
76
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
77
|
+
inputSchema: {
|
|
78
|
+
period: z
|
|
79
|
+
.string()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Year in format YYYY (e.g. '2025') / Ejercicio en formato YYYY"),
|
|
82
|
+
},
|
|
83
|
+
outputSchema: fiscalModeloSummaryOutput,
|
|
84
|
+
}, async ({ period }) => withToolLogging("get_modelo_390_summary", async () => {
|
|
85
|
+
const result = await client.getFiscalModeloSummary("390", period);
|
|
86
|
+
return {
|
|
87
|
+
content: [getContent(formatRecord("Modelo 390 Summary", result))],
|
|
88
|
+
structuredContent: result,
|
|
89
|
+
};
|
|
90
|
+
}));
|
|
91
|
+
// -- get_modelo_180_summary --
|
|
92
|
+
server.registerTool("get_modelo_180_summary", {
|
|
93
|
+
title: "Get Modelo 180 Summary (IRPF Rentals Annual)",
|
|
94
|
+
description: "Get IRPF annual informative summary for rental income withholdings (Modelo 180, Spain). " +
|
|
95
|
+
"Returns total retentions per tenant, property, and annual aggregate. " +
|
|
96
|
+
"Example: period='2025' / " +
|
|
97
|
+
"Obtiene el resumen anual de retenciones sobre alquileres para el Modelo 180. " +
|
|
98
|
+
"Devuelve retenciones totales por inquilino, inmueble y agregado anual.",
|
|
99
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
100
|
+
inputSchema: {
|
|
101
|
+
period: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Year in format YYYY (e.g. '2025') / Ejercicio en formato YYYY"),
|
|
105
|
+
},
|
|
106
|
+
outputSchema: fiscalModeloSummaryOutput,
|
|
107
|
+
}, async ({ period }) => withToolLogging("get_modelo_180_summary", async () => {
|
|
108
|
+
const result = await client.getFiscalModeloSummary("180", period);
|
|
109
|
+
return {
|
|
110
|
+
content: [getContent(formatRecord("Modelo 180 Summary", result))],
|
|
111
|
+
structuredContent: result,
|
|
112
|
+
};
|
|
113
|
+
}));
|
|
114
|
+
// -- get_modelo_347_summary --
|
|
115
|
+
server.registerTool("get_modelo_347_summary", {
|
|
116
|
+
title: "Get Modelo 347 Summary (Operations >€3,005 Annual Recap)",
|
|
117
|
+
description: "Get annual informative summary of operations exceeding €3,005 per counterparty (Modelo 347, Spain). " +
|
|
118
|
+
"Returns per-party totals for clients and vendors above the threshold. " +
|
|
119
|
+
"Example: period='2025' / " +
|
|
120
|
+
"Obtiene el resumen anual de operaciones con terceros superiores a 3.005€ (Modelo 347). " +
|
|
121
|
+
"Devuelve totales por cliente/proveedor que superen el umbral.",
|
|
122
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
123
|
+
inputSchema: {
|
|
124
|
+
period: z
|
|
125
|
+
.string()
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Year in format YYYY (e.g. '2025') / Ejercicio en formato YYYY"),
|
|
128
|
+
},
|
|
129
|
+
outputSchema: fiscalModeloSummaryOutput,
|
|
130
|
+
}, async ({ period }) => withToolLogging("get_modelo_347_summary", async () => {
|
|
131
|
+
const result = await client.getFiscalModeloSummary("347", period);
|
|
132
|
+
return {
|
|
133
|
+
content: [getContent(formatRecord("Modelo 347 Summary", result))],
|
|
134
|
+
structuredContent: result,
|
|
135
|
+
};
|
|
136
|
+
}));
|
|
137
|
+
// -- verifactu_status --
|
|
138
|
+
server.registerTool("verifactu_status", {
|
|
139
|
+
title: "Get VeriFactu Submission Status",
|
|
140
|
+
description: "Get the VeriFactu (AEAT Spanish e-invoice chain) submission status for a specific invoice. " +
|
|
141
|
+
"Returns last submission timestamp, hash, AEAT response code, and QR verification URL. " +
|
|
142
|
+
"/ Obtiene el estado de envio VeriFactu (AEAT) para una factura especifica. " +
|
|
143
|
+
"Devuelve timestamp del ultimo envio, hash, respuesta AEAT y URL del codigo QR.",
|
|
144
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
145
|
+
inputSchema: {
|
|
146
|
+
invoiceId: z.string().describe("Invoice ID / ID de la factura"),
|
|
147
|
+
},
|
|
148
|
+
outputSchema: verifactuStatusOutput,
|
|
149
|
+
}, async ({ invoiceId }) => withToolLogging("verifactu_status", async () => {
|
|
150
|
+
const result = await client.getVerifactuStatus(invoiceId);
|
|
151
|
+
return {
|
|
152
|
+
content: [getContent(formatRecord("VeriFactu Status", result))],
|
|
153
|
+
structuredContent: result,
|
|
154
|
+
};
|
|
155
|
+
}));
|
|
156
|
+
// -- verifactu_resubmit --
|
|
157
|
+
server.registerTool("verifactu_resubmit", {
|
|
158
|
+
title: "Re-submit VeriFactu Submission",
|
|
159
|
+
description: "TRUST AREA — COMPLIANCE. Re-submit a failed or rejected VeriFactu submission to AEAT. " +
|
|
160
|
+
"Idempotent: uses the same hash chain; AEAT deduplicates by hash. " +
|
|
161
|
+
"Creates an audit trail entry for every resubmission attempt. " +
|
|
162
|
+
"Requires confirm=true. Only use on invoices with status='failed'. " +
|
|
163
|
+
"/ AREA DE CONFIANZA — COMPLIANCE. Reenvio de una factura VeriFactu fallida a AEAT. " +
|
|
164
|
+
"Idempotente: misma cadena hash. Registra entrada de auditoria en cada intento. " +
|
|
165
|
+
"Requiere confirm=true. Solo para facturas con status='failed'.",
|
|
166
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
167
|
+
inputSchema: {
|
|
168
|
+
invoiceId: z.string().describe("Invoice ID to resubmit / ID de la factura a reenviar"),
|
|
169
|
+
confirm: z
|
|
170
|
+
.boolean()
|
|
171
|
+
.describe("Must be true to confirm VeriFactu resubmission / Debe ser true para confirmar el reenvio"),
|
|
172
|
+
},
|
|
173
|
+
outputSchema: verifactuStatusOutput,
|
|
174
|
+
}, async ({ invoiceId, confirm }) => withToolLogging("verifactu_resubmit", async () => {
|
|
175
|
+
if (!confirm) {
|
|
176
|
+
return {
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
type: "text",
|
|
180
|
+
text: "Error: confirm=true is required for VeriFactu resubmission. " +
|
|
181
|
+
"This is a COMPLIANCE action that submits fiscal data to AEAT. " +
|
|
182
|
+
"Verify the invoice data is correct before setting confirm=true. / " +
|
|
183
|
+
"Se requiere confirm=true para el reenvio VeriFactu. Accion de COMPLIANCE que envia datos fiscales a AEAT.",
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
isError: true,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
const result = await client.resubmitVerifactu(invoiceId);
|
|
190
|
+
return {
|
|
191
|
+
content: [mutateContent(formatRecord("VeriFactu Resubmitted", result))],
|
|
192
|
+
structuredContent: result,
|
|
193
|
+
};
|
|
194
|
+
}));
|
|
195
|
+
// -- ticketbai_status --
|
|
196
|
+
server.registerTool("ticketbai_status", {
|
|
197
|
+
title: "Get TicketBAI Status (Basque Country)",
|
|
198
|
+
description: "Get the TicketBAI e-invoicing status for an invoice (Basque Country fiscal territories: Araba, Bizkaia, Gipuzkoa). " +
|
|
199
|
+
"Returns submission status, hash, territory province, and AEAT-PV/Bizkaia/Gipuzkoa response. " +
|
|
200
|
+
"/ Obtiene el estado TicketBAI de una factura (territorios forales vascos: Araba, Bizkaia, Gipuzkoa). " +
|
|
201
|
+
"Devuelve estado de envio, hash, provincia y respuesta de la hacienda foral.",
|
|
202
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
203
|
+
inputSchema: {
|
|
204
|
+
invoiceId: z.string().describe("Invoice ID / ID de la factura"),
|
|
205
|
+
},
|
|
206
|
+
outputSchema: ticketbaiStatusOutput,
|
|
207
|
+
}, async ({ invoiceId }) => withToolLogging("ticketbai_status", async () => {
|
|
208
|
+
const result = await client.getTicketbaiStatus(invoiceId);
|
|
209
|
+
return {
|
|
210
|
+
content: [getContent(formatRecord("TicketBAI Status", result))],
|
|
211
|
+
structuredContent: result,
|
|
212
|
+
};
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=fiscal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fiscal.js","sourceRoot":"","sources":["../../src/tools/fiscal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,YAAY,EACZ,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAqB;IAC1E,+BAA+B;IAE/B,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;QACE,KAAK,EAAE,wCAAwC;QAC/C,WAAW,EACT,kEAAkE;YAClE,8FAA8F;YAC9F,8BAA8B;YAC9B,sEAAsE;YACtE,gFAAgF;QAClF,WAAW,EAAE,qBAAqB;QAClC,WAAW,EAAE;YACX,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,kGAAkG,CAAC;SAChH;QACD,YAAY,EAAE,yBAAyB;KACxC,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACzE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAClE,OAAO;YACL,OAAO,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;YACjE,iBAAiB,E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EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;YAC/D,iBAAiB,EAAE,MAA4C;SAChE,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POS (Point of Sale) tools for the Frihet MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Wave 5 — 4 tools for point-of-sale management:
|
|
5
|
+
* list_terminals, get_sale, list_sales, refund_sale
|
|
6
|
+
*
|
|
7
|
+
* ERP backend endpoints land separately (Frihet-ERP S2 sprint).
|
|
8
|
+
* Tools target /v1/pos/terminals and /v1/pos/sales.
|
|
9
|
+
*
|
|
10
|
+
* Trust Area: refund_sale requires explicit confirmation (destructive).
|
|
11
|
+
*/
|
|
12
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
|
+
import type { IFrihetClient } from "../client-interface.js";
|
|
14
|
+
export declare function registerPosTools(server: McpServer, client: IFrihetClient): void;
|
|
15
|
+
//# sourceMappingURL=pos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pos.d.ts","sourceRoot":"","sources":["../../src/tools/pos.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAe5D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAiL/E"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POS (Point of Sale) tools for the Frihet MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Wave 5 — 4 tools for point-of-sale management:
|
|
5
|
+
* list_terminals, get_sale, list_sales, refund_sale
|
|
6
|
+
*
|
|
7
|
+
* ERP backend endpoints land separately (Frihet-ERP S2 sprint).
|
|
8
|
+
* Tools target /v1/pos/terminals and /v1/pos/sales.
|
|
9
|
+
*
|
|
10
|
+
* Trust Area: refund_sale requires explicit confirmation (destructive).
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod/v4";
|
|
13
|
+
import { withToolLogging, formatPaginatedResponse, formatRecord, listContent, getContent, mutateContent, READ_ONLY_ANNOTATIONS, DELETE_ANNOTATIONS, paginatedOutput, posTerminalItemOutput, posSaleItemOutput, } from "./shared.js";
|
|
14
|
+
export function registerPosTools(server, client) {
|
|
15
|
+
// -- list_terminals --
|
|
16
|
+
server.registerTool("list_terminals", {
|
|
17
|
+
title: "List POS Terminals",
|
|
18
|
+
description: "List all configured POS terminals (Stripe Terminal readers) for the workspace. " +
|
|
19
|
+
"Returns terminal label, device type, location, and connection status. " +
|
|
20
|
+
"/ Lista todos los terminales de punto de venta (lectores Stripe Terminal). " +
|
|
21
|
+
"Devuelve etiqueta, tipo de dispositivo, ubicacion y estado de conexion.",
|
|
22
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
23
|
+
inputSchema: {
|
|
24
|
+
locationId: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Filter by location ID / Filtrar por ubicacion"),
|
|
28
|
+
limit: z.number().int().min(1).max(100).optional().describe("Max results (1-100)"),
|
|
29
|
+
offset: z.number().int().min(0).optional().describe("Offset / Desplazamiento"),
|
|
30
|
+
},
|
|
31
|
+
outputSchema: paginatedOutput(posTerminalItemOutput),
|
|
32
|
+
}, async (args) => withToolLogging("list_terminals", async () => {
|
|
33
|
+
const result = await client.listTerminals(args);
|
|
34
|
+
return {
|
|
35
|
+
content: [listContent(formatPaginatedResponse("terminals", result))],
|
|
36
|
+
structuredContent: result,
|
|
37
|
+
};
|
|
38
|
+
}));
|
|
39
|
+
// -- get_sale --
|
|
40
|
+
server.registerTool("get_sale", {
|
|
41
|
+
title: "Get POS Sale",
|
|
42
|
+
description: "Get a single POS sale by ID. Returns full sale details: terminal, items, " +
|
|
43
|
+
"payment method, amounts, and status. " +
|
|
44
|
+
"/ Obtiene una venta POS por ID. Devuelve todos los detalles: terminal, " +
|
|
45
|
+
"articulos, metodo de pago, importes y estado.",
|
|
46
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
47
|
+
inputSchema: {
|
|
48
|
+
id: z.string().describe("Sale ID / ID de venta"),
|
|
49
|
+
},
|
|
50
|
+
outputSchema: posSaleItemOutput,
|
|
51
|
+
}, async ({ id }) => withToolLogging("get_sale", async () => {
|
|
52
|
+
const result = await client.getSale(id);
|
|
53
|
+
return {
|
|
54
|
+
content: [getContent(formatRecord("Sale", result))],
|
|
55
|
+
structuredContent: result,
|
|
56
|
+
};
|
|
57
|
+
}));
|
|
58
|
+
// -- list_sales --
|
|
59
|
+
server.registerTool("list_sales", {
|
|
60
|
+
title: "List POS Sales",
|
|
61
|
+
description: "List POS sales with optional filters by date range, terminal, or status. " +
|
|
62
|
+
"/ Lista las ventas POS con filtros opcionales por fecha, terminal o estado.",
|
|
63
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
64
|
+
inputSchema: {
|
|
65
|
+
terminalId: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Filter by terminal ID / Filtrar por terminal"),
|
|
69
|
+
status: z
|
|
70
|
+
.enum(["succeeded", "pending", "cancelled", "refunded", "partially_refunded"])
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Filter by sale status / Filtrar por estado"),
|
|
73
|
+
from: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Start date YYYY-MM-DD / Fecha de inicio"),
|
|
77
|
+
to: z
|
|
78
|
+
.string()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("End date YYYY-MM-DD / Fecha de fin"),
|
|
81
|
+
limit: z.number().int().min(1).max(100).optional().describe("Max results (1-100)"),
|
|
82
|
+
offset: z.number().int().min(0).optional().describe("Offset / Desplazamiento"),
|
|
83
|
+
after: z
|
|
84
|
+
.string()
|
|
85
|
+
.optional()
|
|
86
|
+
.describe("Cursor for cursor-based pagination / Cursor de paginacion"),
|
|
87
|
+
},
|
|
88
|
+
outputSchema: paginatedOutput(posSaleItemOutput),
|
|
89
|
+
}, async (args) => withToolLogging("list_sales", async () => {
|
|
90
|
+
const result = await client.listSales(args);
|
|
91
|
+
return {
|
|
92
|
+
content: [listContent(formatPaginatedResponse("sales", result))],
|
|
93
|
+
structuredContent: result,
|
|
94
|
+
};
|
|
95
|
+
}));
|
|
96
|
+
// -- refund_sale --
|
|
97
|
+
// Trust Area: destructive action. Requires explicit `confirm: true` flag.
|
|
98
|
+
server.registerTool("refund_sale", {
|
|
99
|
+
title: "Refund POS Sale",
|
|
100
|
+
description: "Refund a POS sale in full or partially. This action is irreversible — " +
|
|
101
|
+
"the customer will receive a refund to their original payment method. " +
|
|
102
|
+
"You MUST pass confirm=true to proceed. Optionally specify amountCents for " +
|
|
103
|
+
"a partial refund (defaults to full refund). " +
|
|
104
|
+
"/ Reembolsa una venta POS total o parcialmente. Accion irreversible. " +
|
|
105
|
+
"Debes pasar confirm=true. Pasa amountCents para reembolso parcial.",
|
|
106
|
+
annotations: DELETE_ANNOTATIONS,
|
|
107
|
+
inputSchema: {
|
|
108
|
+
id: z.string().describe("Sale ID to refund / ID de venta a reembolsar"),
|
|
109
|
+
confirm: z
|
|
110
|
+
.boolean()
|
|
111
|
+
.describe("Must be true to proceed. Safety gate for destructive action. " +
|
|
112
|
+
"/ Debe ser true para continuar. Confirmacion obligatoria."),
|
|
113
|
+
amountCents: z
|
|
114
|
+
.number()
|
|
115
|
+
.int()
|
|
116
|
+
.positive()
|
|
117
|
+
.optional()
|
|
118
|
+
.describe("Partial refund amount in cents. Omit for full refund. " +
|
|
119
|
+
"/ Importe parcial en centimos. Omitir para reembolso completo."),
|
|
120
|
+
reason: z
|
|
121
|
+
.enum(["duplicate", "fraudulent", "requested_by_customer", "other"])
|
|
122
|
+
.optional()
|
|
123
|
+
.describe("Refund reason / Motivo del reembolso"),
|
|
124
|
+
},
|
|
125
|
+
outputSchema: z.object({
|
|
126
|
+
id: z.string(),
|
|
127
|
+
saleId: z.string(),
|
|
128
|
+
status: z.enum(["succeeded", "pending", "failed"]),
|
|
129
|
+
amountCents: z.number().int().nonnegative(),
|
|
130
|
+
currency: z.string(),
|
|
131
|
+
reason: z.string().optional(),
|
|
132
|
+
createdAt: z.string(),
|
|
133
|
+
}).passthrough(),
|
|
134
|
+
}, async ({ id, confirm, amountCents, reason }) => withToolLogging("refund_sale", async () => {
|
|
135
|
+
if (!confirm) {
|
|
136
|
+
return {
|
|
137
|
+
content: [
|
|
138
|
+
{
|
|
139
|
+
type: "text",
|
|
140
|
+
text: "Error: refund_sale requires confirm=true to proceed. " +
|
|
141
|
+
"This action is irreversible — the customer will receive a refund. " +
|
|
142
|
+
"/ Se requiere confirm=true. Esta accion es irreversible.",
|
|
143
|
+
annotations: { audience: ["user"], priority: 1.0 },
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
isError: true,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const result = await client.refundSale(id, { amountCents, reason });
|
|
150
|
+
return {
|
|
151
|
+
content: [mutateContent(formatRecord("Refund created", result))],
|
|
152
|
+
structuredContent: result,
|
|
153
|
+
};
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=pos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pos.js","sourceRoot":"","sources":["../../src/tools/pos.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO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AC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;QACpE,OAAO;YACL,OAAO,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;YAChE,iBAAiB,EAAE,MAA4C;SAChE,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recurring invoice tools for the Frihet MCP server — Wave 6 (2 tools).
|
|
3
|
+
*
|
|
4
|
+
* Tools:
|
|
5
|
+
* 1. list_recurring_invoices — list recurring invoice templates
|
|
6
|
+
* 2. run_recurring_now — manually trigger generation of next instance from template
|
|
7
|
+
*
|
|
8
|
+
* REST surface: /v1/recurring/invoices
|
|
9
|
+
*
|
|
10
|
+
* NOTE: ERP backend endpoints /v1/recurring/* are planned. Tools are wired
|
|
11
|
+
* and will surface 404 errors until the backend ships.
|
|
12
|
+
*/
|
|
13
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import type { IFrihetClient } from "../client-interface.js";
|
|
15
|
+
export declare function registerRecurringTools(server: McpServer, client: IFrihetClient): void;
|
|
16
|
+
//# sourceMappingURL=recurring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurring.d.ts","sourceRoot":"","sources":["../../src/tools/recurring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAa5D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAgErF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recurring invoice tools for the Frihet MCP server — Wave 6 (2 tools).
|
|
3
|
+
*
|
|
4
|
+
* Tools:
|
|
5
|
+
* 1. list_recurring_invoices — list recurring invoice templates
|
|
6
|
+
* 2. run_recurring_now — manually trigger generation of next instance from template
|
|
7
|
+
*
|
|
8
|
+
* REST surface: /v1/recurring/invoices
|
|
9
|
+
*
|
|
10
|
+
* NOTE: ERP backend endpoints /v1/recurring/* are planned. Tools are wired
|
|
11
|
+
* and will surface 404 errors until the backend ships.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod/v4";
|
|
14
|
+
import { withToolLogging, formatPaginatedResponse, formatRecord, listContent, mutateContent, READ_ONLY_ANNOTATIONS, paginatedOutput, actionResultOutput, recurringInvoiceItemOutput, } from "./shared.js";
|
|
15
|
+
export function registerRecurringTools(server, client) {
|
|
16
|
+
// -- list_recurring_invoices --
|
|
17
|
+
server.registerTool("list_recurring_invoices", {
|
|
18
|
+
title: "List Recurring Invoices",
|
|
19
|
+
description: "List all recurring invoice templates. " +
|
|
20
|
+
"Returns template name, frequency, next scheduled run date, recipient, line items, and active/paused status. " +
|
|
21
|
+
"/ Lista todas las plantillas de facturas recurrentes. " +
|
|
22
|
+
"Devuelve nombre de la plantilla, frecuencia, proxima fecha de ejecucion, destinatario, lineas y estado.",
|
|
23
|
+
annotations: READ_ONLY_ANNOTATIONS,
|
|
24
|
+
inputSchema: {
|
|
25
|
+
status: z
|
|
26
|
+
.enum(["active", "paused"])
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Filter by status / Filtrar por estado"),
|
|
29
|
+
limit: z.number().int().min(1).max(100).optional().describe("Max results (1-100) / Resultados maximos"),
|
|
30
|
+
offset: z.number().int().min(0).optional().describe("Offset / Desplazamiento"),
|
|
31
|
+
},
|
|
32
|
+
outputSchema: paginatedOutput(recurringInvoiceItemOutput),
|
|
33
|
+
}, async ({ status, limit, offset }) => withToolLogging("list_recurring_invoices", async () => {
|
|
34
|
+
const result = await client.listRecurringInvoices({ status, limit, offset });
|
|
35
|
+
return {
|
|
36
|
+
content: [listContent(formatPaginatedResponse("recurring_invoices", result))],
|
|
37
|
+
structuredContent: result,
|
|
38
|
+
};
|
|
39
|
+
}));
|
|
40
|
+
// -- run_recurring_now --
|
|
41
|
+
server.registerTool("run_recurring_now", {
|
|
42
|
+
title: "Run Recurring Invoice Now",
|
|
43
|
+
description: "Manually trigger immediate generation of the next invoice instance from a recurring template. " +
|
|
44
|
+
"Useful for billing ahead of schedule or recovering from a missed automated run. " +
|
|
45
|
+
"The generated invoice is created as a draft; review and send separately. " +
|
|
46
|
+
"Example: templateId='rec_abc123' " +
|
|
47
|
+
"/ Genera manualmente la siguiente instancia de una factura recurrente. " +
|
|
48
|
+
"Util para facturar antes de lo programado o recuperar un ciclo perdido. " +
|
|
49
|
+
"La factura generada se crea como borrador; revisar y enviar por separado.",
|
|
50
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
51
|
+
inputSchema: {
|
|
52
|
+
templateId: z.string().describe("Recurring invoice template ID / ID de la plantilla de factura recurrente"),
|
|
53
|
+
draftOnly: z
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("If true, create as draft only (default true). Set false to create and mark as sent immediately. / Si true, crea como borrador. Set false para crear y marcar como enviada."),
|
|
57
|
+
},
|
|
58
|
+
outputSchema: actionResultOutput,
|
|
59
|
+
}, async ({ templateId, draftOnly }) => withToolLogging("run_recurring_now", async () => {
|
|
60
|
+
const result = await client.runRecurringNow(templateId, { draftOnly: draftOnly ?? true });
|
|
61
|
+
return {
|
|
62
|
+
content: [mutateContent(formatRecord("Recurring invoice triggered", result))],
|
|
63
|
+
structuredContent: result,
|
|
64
|
+
};
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=recurring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurring.js","sourceRoot":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
|
+
* Barrel module that registers all 94 Frihet ERP tools on an McpServer.
|
|
3
3
|
*
|
|
4
4
|
* Used by both the local (stdio) and remote (Cloudflare Workers) servers
|
|
5
5
|
* so tool definitions stay in sync — one source of truth.
|
|
6
6
|
*
|
|
7
7
|
* Langfuse observability is injected by patching server.registerTool once
|
|
8
8
|
* before any tool registration. This wraps every tool callback with
|
|
9
|
-
* traceMCPTool so all
|
|
9
|
+
* traceMCPTool so all 94 tools are instrumented at zero per-tool cost.
|
|
10
10
|
*/
|
|
11
11
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
12
12
|
import type { IFrihetClient } from "../client-interface.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/tools/register-all.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/tools/register-all.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAiD5D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAqB/E"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Barrel module that registers all
|
|
2
|
+
* Barrel module that registers all 94 Frihet ERP tools on an McpServer.
|
|
3
3
|
*
|
|
4
4
|
* Used by both the local (stdio) and remote (Cloudflare Workers) servers
|
|
5
5
|
* so tool definitions stay in sync — one source of truth.
|
|
6
6
|
*
|
|
7
7
|
* Langfuse observability is injected by patching server.registerTool once
|
|
8
8
|
* before any tool registration. This wraps every tool callback with
|
|
9
|
-
* traceMCPTool so all
|
|
9
|
+
* traceMCPTool so all 94 tools are instrumented at zero per-tool cost.
|
|
10
10
|
*/
|
|
11
11
|
import { traceMCPTool } from "../observability.js";
|
|
12
12
|
import { registerInvoiceTools } from "./invoices.js";
|
|
@@ -19,6 +19,13 @@ import { registerWebhookTools } from "./webhooks.js";
|
|
|
19
19
|
import { registerIntelligenceTools } from "./intelligence.js";
|
|
20
20
|
import { registerCrmTools } from "./crm.js";
|
|
21
21
|
import { registerDepositTools } from "./deposits.js";
|
|
22
|
+
import { registerEInvoiceTools } from "./einvoice.js";
|
|
23
|
+
import { registerStayTools } from "./stay.js";
|
|
24
|
+
import { registerPosTools } from "./pos.js";
|
|
25
|
+
import { registerBankingTools } from "./banking.js";
|
|
26
|
+
import { registerFiscalTools } from "./fiscal.js";
|
|
27
|
+
import { registerTimeTools } from "./time.js";
|
|
28
|
+
import { registerRecurringTools } from "./recurring.js";
|
|
22
29
|
/**
|
|
23
30
|
* Patches server.registerTool to wrap every tool callback with Langfuse tracing.
|
|
24
31
|
*
|
|
@@ -55,5 +62,12 @@ export function registerAllTools(server, client) {
|
|
|
55
62
|
registerVendorTools(server, client);
|
|
56
63
|
registerWebhookTools(server, client);
|
|
57
64
|
registerDepositTools(server, client);
|
|
65
|
+
registerEInvoiceTools(server, client);
|
|
66
|
+
registerStayTools(server, client);
|
|
67
|
+
registerPosTools(server, client);
|
|
68
|
+
registerBankingTools(server, client);
|
|
69
|
+
registerFiscalTools(server, client);
|
|
70
|
+
registerTimeTools(server, client);
|
|
71
|
+
registerRecurringTools(server, client);
|
|
58
72
|
}
|
|
59
73
|
//# sourceMappingURL=register-all.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-all.js","sourceRoot":"","sources":["../../src/tools/register-all.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC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