# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.1] - 2025-07-09

### Fixed
- **Critical Bug Fix**: Fixed "Cannot read properties of undefined (reading 'industry')" error in predict_roi tool
  - Added proper Zod schema validation for input arguments in index.ts
  - Added safety check in predict-roi.ts to validate project data exists before accessing properties
  - Applied same validation pattern to compare_projects tool for consistency
- **Input Validation**: Tools now properly parse and validate input arguments before processing
  - Prevents runtime errors from malformed input
  - Provides clear validation error messages to users
  - Ensures type safety throughout tool execution

### Improved
- Enhanced error handling with more descriptive validation messages
- Better consistency between predict_roi and compare_projects tools

## [1.3.0] - 2025-07-03

### Breaking Changes
- **Removed quick-assessment tool**: This tool has been completely removed from the codebase
- **PERPLEXITY_API_KEY is now mandatory**: Required for Dutch market validation in all tools

### Added
- **Dutch Market Validation**: All ROI predictions and project comparisons now include mandatory Dutch market validation
  - New `DutchBenchmarkValidator` service integrates with Perplexity API
  - Automatic validation of input values against Dutch industry averages
  - Intelligent adjustment of unrealistic values (e.g., savings > 3x industry average)
  - Detailed rationale provided for all adjustments
- **Enhanced Validation Results**: Both predict-roi and compare-projects tools now include:
  - `dutchValidation` section with adjustment details
  - Market-specific insights and trends
  - Citations from authoritative Dutch sources
  - Confidence scores based on market alignment

### Changed
- predict-roi tool: Perplexity validation is now the mandatory first step
- compare-projects tool: Each project undergoes individual Dutch market validation
- Configuration validation now requires PERPLEXITY_API_KEY
- Tool descriptions updated to mention Dutch market focus

### Removed
- quick-assessment tool and all related code
- QuickUseCase schema and associated methods
- All quick assessment functionality from service files

### Security
- PERPLEXITY_API_KEY validation added to startup checks
- Enhanced error handling for API failures

## [1.2.0] - 2025-07-01

### Added
- **Natural Language Processing**: All tools now support natural language input
  - Universal NLP service for intent detection and entity extraction
  - Context awareness maintains conversation history
  - Support for relative values ("reduce by half", "triple the output")
- **Smart Defaults**: 80% reduction in required input fields
  - Industry-specific implementation cost defaults
  - Intelligent timeline estimation
  - Automatic use case generation based on project type
- **Flexible Input Formats**:
  - Accept currency strings: "$50k", "$1.5M", "100 thousand dollars"
  - Accept percentages: "85%", "90 percent", "half"
  - Accept time periods: "6 months", "2 years", "quarterly"
  - Fuzzy matching for enums: "tech" → "technology", "fin" → "financial_services"
- **Enhanced Error Handling**:
  - User-friendly error messages with examples
  - "Did you mean?" suggestions for common mistakes
  - Auto-correction for simple errors
  - Field-specific guidance and constraints
- **New Utility Tools**:
  - `get_examples`: Retrieve relevant usage examples for any tool
  - `help`: Interactive help system with tool recommendations
- **LLM Optimizations**:
  - Self-documenting tools with embedded examples
  - Structured responses with confidence indicators
  - Next steps and alternative approaches in responses
  - Comprehensive prompt engineering guide

### Changed
- Enhanced all tool descriptions with capabilities and examples
- Improved response structure with `next_steps` and `confidence_indicators`
- Updated error responses to include recovery suggestions
- Simplified input schemas while maintaining backward compatibility

### Fixed
- Error messages now provide actionable guidance
- Enum validation accepts common variations
- Numeric parsing handles various formats

## [1.1.1] - 2025-06-30

### Fixed
- Database connection handling improvements
- Performance optimizations for Monte Carlo simulations
- Error message clarity

## [1.1.0] - 2025-06-28

### Added
- Enhanced ML comparison engine
- Improved industry benchmark integration
- Voice output support for accessibility

### Changed
- Optimized worker pool performance
- Enhanced response transformer logic

## [1.0.0] - 2025-06-24

### Added
- Initial release with full MCP implementation
- Three core tools: predict_roi, compare_projects, quick_assessment
- Monte Carlo simulation with parallel processing
- Real-time industry benchmarks via Perplexity API
- ML-powered project comparison
- Natural language support for quick_assessment
- Comprehensive transaction management
- Atomic operations with rollback support
- Retry logic with exponential backoff
- Financial calculators (NPV, IRR, Payback Period)
- 5-year ROI projections
- Industry-specific calculations for 7 sectors
- Supabase PostgreSQL integration
- Worker thread pool for CPU-intensive tasks
- Structured logging with context
- Graceful API degradation

[1.3.1]: https://github.com/SPAIK-io/mcp-server-roi/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/SPAIK-io/mcp-server-roi/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/SPAIK-io/mcp-server-roi/compare/v1.1.1...v1.2.0
[1.1.1]: https://github.com/SPAIK-io/mcp-server-roi/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/SPAIK-io/mcp-server-roi/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/SPAIK-io/mcp-server-roi/releases/tag/v1.0.0