# MCP server use cases

Connect your AI assistant (Claude, for example) to the [Ticketbai WS MCP server](https://ticketbaiws.eus/en/desarrolladores/mcp/) 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](https://ticketbaiws.eus/en/desarrolladores/mcp/) 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.

   AI assistant · Ticketbai WS Simulated example

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.

AI

This is the invoice I'm going to issue in series A:

Labor · 2 h × €45.00 **€90.00**

Water pump impeller · 1 × €60.00 **€60.00**

Tax base **€150.00**

VAT 21% **€31.50**

Total **€181.50**

Shall I issue it?

Yes, go ahead.

AI

✓ `ticketbai_post` POST /tbai/ · PENDING

✓ `ticketbai_get` GET /tbai/ · OK

Done! I've issued the invoice and **the tax authority has accepted it**.

Invoice A-2026-0157 ACCEPTED

Customer **Talleres Ejemplo S.L.**

Total **€181.50**

 `TBAI-B01010101-041126-3fKq8Lw2pXnZ9-153`

Would you like me to email it to the customer?

Case 1

## “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

1. `ticketbai_post` creates the invoice: Ticketbai WS signs it, chains it and immediately returns the fingerprint and the QR code.
2. Submission to the tax authority happens in the background (`PENDING`), so the assistant confirms the result with `ticketbai_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
}
```

   AI assistant · Ticketbai WS Simulated example

Record this invoice from my supplier in the LROE.

📎 supplies-invoice-october.pdf

AI

It'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.

AI

✓ `lroe_recibidas_post` POST /lroe-recibidas/ · Batuz

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.

F-2026-0981 · Suministros Hidráulicos Ejemplo S.A. CORRECT

Date **28/10/2026**

Description **Purchase of impellers and seals**

Tax base **€600.00**

Input VAT 21% **€126.00**

Total **€726.00**

Case 2 · Bizkaia

## “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

1. The assistant reads the PDF and prepares the data: supplier, number, date, description and tax bases.
2. The LROE requires the type of each received invoice (`compras` = purchases, `inversion` = capital goods or `gasto` = expense). If the invoice doesn't make it clear, the assistant asks you.
3. `lroe_recibidas_post` records 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 }]
  }]
}
```

   AI assistant · Ticketbai WS + email Simulated example

Send the third-quarter invoices to my accountant (accountant@example.com).

AI

✓ `ticketbai_list_get` 01/07/2026 – 30/09/2026 · 48 invoices

✓ `Email · send message` your email connector

Sent. I've emailed your accountant the third-quarter summary with the list of invoices attached:

Q3 2026 SENT

Issued invoices **48**

Tax base **€12,480.00**

Output VAT **€2,620.80**

Accepted by the tax authority **48 of 48**

 invoices-2026-Q3.csv

Case 3

## “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

1. `ticketbai_list_get` returns the invoices for the period with their amount and their status with the tax authority.
2. 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
```

   AI assistant · Ticketbai WS + email Simulated example

Yes, send invoice A-2026-0157 to admin@talleres-ejemplo.es.

AI

✓ `tbai_pdf_get` GET /tbai-pdf/ · A-2026-0157

✓ `Email · send message` your email connector

Sent. I've emailed them the invoice as a PDF, with the TicketBAI QR code:

To admin@talleres-ejemplo.es

Subject Invoice A-2026-0157 · Water pump repair

Message Hello, please find attached the invoice for the repair. Best regards.
 invoice-A-2026-0157.pdf

Case 4

## “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

1. `tbai_pdf_get` downloads the invoice PDF, with its QR code.
2. 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.

[Set up the MCP server →](https://ticketbaiws.eus/en/desarrolladores/mcp/)

Source: https://ticketbaiws.eus/en/desarrolladores/casos-de-uso-mcp/
