> ## Documentation Index
> Fetch the complete documentation index at: https://developers.manglai.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools — Facturas

> Consulta facturas de suministros con el MCP de Manglai

## Tools disponibles

| Tool                     | Endpoint                         | Descripción                   |
| ------------------------ | -------------------------------- | ----------------------------- |
| `get_invoices`           | `GET /api/v1/invoices`           | Lista de facturas con filtros |
| `get_invoice`            | `GET /api/v1/invoices/{id}`      | Detalle de una factura        |
| `get_invoices_dashboard` | `GET /api/v1/invoices/dashboard` | Resumen de facturas           |

## Tipos de factura

* `heat` — Calor/Energía térmica
* `fuel` — Combustibles
* `electricity` — Electricidad
* `generated-energy` — Energía generada
* `process-emissions` — Emisiones de proceso
* `water` — Agua
* `wastes` — Residuos
* `wastes-expenses` — Gastos de gestión de residuos
* `waste-water` — Aguas residuales
* `others` — Otros

## Ejemplos de uso

```
"Lista las facturas de electricidad de este año"
→ get_invoices({ companyId: "uuid", type: "electricity", startDate: "2024-01-01", endDate: "2024-12-31" })

"Dame el detalle de la factura X"
→ get_invoice({ id: "uuid-factura" })

"¿Cuánto hemos gastado en facturas de agua en Q1?"
→ get_invoices_dashboard({ companyId: "uuid", type: "water", startDate: "2024-01-01", endDate: "2024-03-31" })
```

## Parámetros comunes

### `get_invoices`

| Parámetro     | Tipo      | Descripción               |
| ------------- | --------- | ------------------------- |
| `companyId`   | string    | ID de empresa (requerido) |
| `type`        | string    | Tipo de factura           |
| `startDate`   | string    | Fecha inicio (ISO 8601)   |
| `endDate`     | string    | Fecha fin (ISO 8601)      |
| `buildingIds` | string\[] | Filtrar por edificios     |
| `page`        | integer   | Número de página          |
| `limit`       | integer   | Resultados por página     |
