MCP server use cases
Connect your AI assistant (Claude, for example) to the Ticketbai WS MCP server and invoice just by talking. These are example conversations, showing the real tools the assistant uses in each case.
1. The Ticketbai WS connector
Add the MCP server to your assistant with your company's token and NIF. Start in the test environment.
2. An email connector (optional)
To send invoices by email, your assistant also needs its email connector (Gmail, Outlook…). The email is sent from your account, not from Ticketbai WS.
3. Review before issuing
In production, invoices are legally valid: ask the assistant to show you the details and confirm before issuing.
Make me an invoice for Talleres Ejemplo S.L. (B01000012, Calle Mayor 12, 48001 Bilbao) for repairing their water pump: 2 hours of labor at €45 and a new impeller for €60. 21% VAT.
This is the invoice I'm going to issue in series A:
Shall I issue it?
Yes, go ahead.
ticketbai_post ticketbai_get Done! I've issued the invoice and the tax authority has accepted it.
TBAI-B01010101-041126-3fKq8Lw2pXnZ9-153Would you like me to email it to the customer?
“Make me an invoice for the pump repair”
You describe the invoice the way you would describe it to a person, and the assistant fills in the details, calculates the amounts and shows them to you before issuing.
What happens behind the scenes
ticketbai_postcreates the invoice: Ticketbai WS signs it, chains it and immediately returns the fingerprint and the QR code.- Submission to the tax authority happens in the background (
PENDING), so the assistant confirms the result withticketbai_get.
View the API call
POST /tbai/
{
"fecha": "04/11/2026", "hora": "10:24:00",
"serie": "A", "numero": "2026-0157",
"simplificada": false, "rectificativa": false,
"nif": "B01000012", "nombre": "Talleres Ejemplo S.L.",
"direccion": "Calle Mayor 12", "cp": "48001",
"lineas": [
{ "descripcion": "Labor", "cantidad": 2, "importe_unitario": 45.00, "tipo_iva": 21, "tipo_req": 0 },
{ "descripcion": "Water pump impeller", "cantidad": 1, "importe_unitario": 60.00, "tipo_iva": 21, "tipo_req": 0 }
],
"retencion": 0, "total_factura": 181.50
}
Record this invoice from my supplier in the LROE.
📎 supplies-invoice-october.pdfIt's invoice F-2026-0981 from Suministros Hidráulicos Ejemplo S.A.: €600.00 + €126.00 VAT, for “purchase of impellers and seals”. For the LROE I need to know what type it is:
Is it a purchase of goods, an acquisition of capital goods or an expense?
A purchase of goods: they're parts for the repairs.
lroe_recibidas_post All set: I've recorded the invoice in the Batuz LROE as a purchase of goods for fiscal year 2026, and the tax authority has marked it as correct.
“Send this invoice to the LROE”
If your company is in Bizkaia, the invoices you receive from your suppliers also go to the tax authority, in the Batuz LROE. Give the assistant the invoice PDF and it extracts the data and records it.
What happens behind the scenes
- The assistant reads the PDF and prepares the data: supplier, number, date, description and tax bases.
- The LROE requires the type of each received invoice (
compras= purchases,inversion= capital goods orgasto= expense). If the invoice doesn't make it clear, the assistant asks you. lroe_recibidas_postrecords the invoice in the received invoices chapter of the LROE.
View the API call
POST /lroe-recibidas/
{
"ejercicio": 2026,
"facturas": [{
"fecha": "28/10/2026",
"nif": "B01000020", "nombre_social": "Suministros Hidráulicos Ejemplo S.A.",
"num_factura": "F-2026-0981",
"descripcion": "Purchase of impellers and seals",
"tipo_factura": "compras", "importacion": false, "rectificativa": false,
"importe_total": 726.00,
"bases": [{ "base_imponible": 600.00, "tipo_iva": 21, "tipo_req": 0 }]
}]
}
Send the third-quarter invoices to my accountant (accountant@example.com).
ticketbai_list_get Email · send message Sent. I've emailed your accountant the third-quarter summary with the list of invoices attached:
“Send the quarter's invoices to my accountant”
When you close the quarter, ask the assistant to gather your invoices and send them to whoever keeps your books, with the summary already done.
What happens behind the scenes
ticketbai_list_getreturns the invoices for the period with their amount and their status with the tax authority.- The assistant calculates the summary, prepares the list and sends it with your email connector. Ticketbai WS does not send the email.
View the API call
GET /tbai-list/?fecha_inicio=01/07/2026&fecha_fin=30/09/2026
Yes, send invoice A-2026-0157 to admin@talleres-ejemplo.es.
tbai_pdf_get Email · send message Sent. I've emailed them the invoice as a PDF, with the TicketBAI QR code:
“Email the invoice to the customer”
Right after issuing it, or weeks later: the assistant downloads the invoice PDF and sends it to the customer from your email account.
What happens behind the scenes
tbai_pdf_getdownloads the invoice PDF, with its QR code.- The assistant writes the message and sends it with your email connector, attaching the PDF.
View the API call
GET /tbai-pdf/?serie=A&numero=2026-0157
More ideas
- “Has the tax authority accepted all of yesterday's invoices? Tell me which ones failed and why.”
- “The customer returned the impeller: create a corrective invoice for invoice A-2026-0157.”
- “Turn receipts 0412 and 0413 into a full invoice for Talleres Ejemplo.”
- “Cancel invoice A-2026-0160, I issued it by mistake.”
The conversations on this page are simulated examples: real answers depend on your assistant and your company's data. Always check amounts, customers and VAT before issuing in production.
