You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(analytics): add lost customers recovery tool for client retention analysis
- Add get_clientes_perdidos tool to identify customers who had previous purchase history but haven't bought since a specified date
- Implement comprehensive client analysis with historical statistics (total invoices, revenue, last purchase date)
- Add smart date handling between FacturaScripts DD-MM-YYYY and ISO YYYY-MM-DD formats
- Include robust pagination and chronological sorting by last purchase date
- Provide client contact information for targeted retention campaigns
- Add 19 comprehensive tests (14 unit + 5 integration) with full scenario coverage
- Update tool registration in main server and module exports
- Enhance documentation with usage examples and business use cases
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- ✅ **59 MCP Resources** - Complete FacturaScripts API coverage including OpenAPI part16 implementation
556
-
- ✅ **65 Interactive Tools** - Full Claude Desktop integration with advanced filtering including specialized business analytics
557
-
- ✅ **566 Tests Passing** - Comprehensive unit & integration testing with modular organization including specialized business tools
556
+
- ✅ **66 Interactive Tools** - Full Claude Desktop integration with advanced filtering including specialized business analytics and customer retention tools
557
+
- ✅ **567+ Tests Passing** - Comprehensive unit & integration testing with modular organization including specialized business tools and customer retention analytics
558
558
- ✅ **Live API Integration** - Working with real FacturaScripts instances
559
559
- ✅ **Advanced API Support** - Full FacturaScripts filtering, sorting, and pagination
560
560
- ✅ **TypeScript Strict Mode** - Full type safety and IntelliSense
561
561
- ✅ **Production Ready** - Error handling, documentation, and monitoring
562
562
- ✅ **Automated Changelog** - Conventional commits and automated release management with Keep a Changelog format
563
563
- ✅ **Enhanced Documentation** - Comprehensive guides and best practices
564
-
- ✅ **Specialized Business Tools** - Advanced invoice search by CIF/NIF and best-selling products analytics with comprehensive error handling
564
+
- ✅ **Specialized Business Tools** - Advanced customer analytics including lost client recovery, invoice search by CIF/NIF, best-selling products, and customer retention analytics with comprehensive error handling
description: 'Obtiene una lista de clientes que tenían facturas anteriormente pero no han comprado desde una fecha específica hasta ahora. Excluye clientes que nunca han comprado (sin historial de facturas). Realiza análisis en tres pasos: 1) Obtiene todos los clientes con historial de facturas, 2) Identifica clientes con facturas anteriores a la fecha límite, 3) Filtra aquellos sin facturas desde la fecha hasta hoy. Útil para campañas de recuperación de clientes perdidos, análisis de retención y estrategias de reactivación.',
441
+
inputSchema: {
442
+
type: 'object',
443
+
properties: {
444
+
fecha_desde: {type: 'string',description: 'Fecha límite desde la cual considerar clientes como perdidos (formato: YYYY-MM-DD). Clientes sin facturas desde esta fecha hasta hoy se consideran perdidos.'},
445
+
limit: {type: 'number',description: 'Número máximo de clientes perdidos a devolver (1-1000)',minimum: 1,maximum: 1000,default: 100},
446
+
offset: {type: 'number',description: 'Número de clientes a omitir para paginación',minimum: 0,default: 0}
447
+
},
448
+
required: ['fecha_desde']
449
+
}
450
+
},
438
451
{
439
452
name: 'get_clientes_sin_compras',
440
453
description: 'Obtiene una lista de clientes que no han realizado compras (no aparecen en facturas de clientes) en un rango de fechas específico. Realiza búsqueda en dos pasos: 1) Obtiene todos los clientes activos, 2) Filtra aquellos sin facturas en el período. Útil para campañas de reactivación, análisis de clientes inactivos y estrategias de retención.',
0 commit comments