v2.0.7 - Bug Fix Release: Sample Values & Query Timeout
π v2.0.7 - Bug Fix Release: Sample Values & Query Timeout
Bug Fix Release π οΈ
Release Date: October 13, 2025
Author: Arjun Trivedi
Email: [email protected]
Repository: https://github.com/4R9UN/mcp-kql-server
π What's Fixed in v2.0.7
This release addresses critical bugs in the schema discovery system that were preventing sample values from being populated and causing query timeout issues.
1. Sample Values Bug Fix
- π§ Fixed Empty Sample Values: Resolved issue where
sample_valuesfield was returning empty arrays in schema discovery - π Data Population: All three schema discovery strategies now properly execute
| take 2queries to fetch actual sample data - β Consistent Behavior: Strategy 1 (JSON Schema) and Strategy 2 (getschema) now match Strategy 3's working implementation
- π― Real Data Examples: AI-enhanced column descriptions now have access to actual table data for better context
2. Query Timeout Improvements
- β‘ Enhanced Error Handling: Improved handling of query timeout scenarios
- π οΈ Better Error Messages: More informative error messages when queries time out
- π Logging Enhancements: Better debugging information for timeout-related issues
π§ Technical Changes
Schema Discovery Enhancement (utils.py)
Strategy 1 - JSON Schema Discovery (Lines 1841-1867):
- Added sample data query execution after schema discovery
- Extracts sample values for each column from
| take 2results - Populates
sample_valueswith actual table data - Includes error handling for sample data retrieval failures
Strategy 2 - getschema Discovery (Lines 1871-1913):
- Added sample data query execution after getschema
- Extracts sample values for each column from
| take 2results - Populates
sample_valueswith actual table data - Includes error handling for sample data retrieval failures
Key Implementation Pattern:
# Get sample data for all columns
sample_data = {}
try:
bracketed_table = bracket_if_needed(table)
sample_query = f"{bracketed_table} | take 2"
sample_result = await self._execute_kusto_async(sample_query, cluster, database, is_mgmt=False)
if sample_result and len(sample_result) > 0:
# Extract sample values for each column
sample_values = [str(row.get(col_name, '')) for row in sample_result[:2]
if row.get(col_name) is not None]
sample_data[col_name] = sample_values
except Exception as sample_error:
logger.debug(f"Failed to get sample data: {sample_error}")π Bug Fixes
Critical Fixes
- Sample Values Population: Fixed bug where Strategy 1 and Strategy 2 weren't fetching actual sample data from tables
- Query Execution: Ensured
| take 2queries execute properly to populate sample values - Error Handling: Added proper error handling for sample data retrieval to prevent schema discovery failures
- Consistency: All three schema discovery strategies now behave identically regarding sample values
Impact
- AI Context: AI models now receive actual data samples for better column understanding
- Query Generation: Improved natural language to KQL query generation with real data context
- Schema Intelligence: Enhanced schema descriptions with actual value examples
π¦ Installation & Upgrade
New Installation
pip install mcp-kql-server==2.0.7Upgrade from Previous Versions
pip install --upgrade mcp-kql-serverπ― Benefits
- Enhanced AI Context: AI models now have access to real sample values for better understanding
- Improved Query Generation: Better natural language to KQL conversion with actual data examples
- Consistent Behavior: All schema discovery strategies now provide complete information
- Better Debugging: Enhanced error messages and logging for troubleshooting
β Quality Assurance
- Schema Discovery: Verified all three strategies now populate sample values correctly
- Query Execution: Confirmed
| take 2queries execute successfully across different tables - Error Handling: Validated proper error handling when sample data retrieval fails
- Backward Compatibility: Changes are fully backward compatible with existing implementations
π v2.0.7 - Bug Fix Release: Sample Values & Query Timeout
Bug Fix Release π οΈ
Release Date: October 13, 2025
Author: Arjun Trivedi
Email: [email protected]
Repository: https://github.com/4R9UN/mcp-kql-server
π What's Fixed in v2.0.7
This release addresses critical bugs in the schema discovery system that were preventing sample values from being populated and causing query timeout issues.
1. Sample Values Bug Fix
- π§ Fixed Empty Sample Values: Resolved issue where
sample_valuesfield was returning empty arrays in schema discovery - π Data Population: All three schema discovery strategies now properly execute
| take 2queries to fetch actual sample data - β Consistent Behavior: Strategy 1 (JSON Schema) and Strategy 2 (getschema) now match Strategy 3's working implementation
- π― Real Data Examples: AI-enhanced column descriptions now have access to actual table data for better context
2. Query Timeout Improvements
- β‘ Enhanced Error Handling: Improved handling of query timeout scenarios
- π οΈ Better Error Messages: More informative error messages when queries time out
- π Logging Enhancements: Better debugging information for timeout-related issues
π§ Technical Changes
Schema Discovery Enhancement (utils.py)
Strategy 1 - JSON Schema Discovery (Lines 1841-1867):
- Added sample data query execution after schema discovery
- Extracts sample values for each column from
| take 2results - Populates
sample_valueswith actual table data - Includes error handling for sample data retrieval failures
Strategy 2 - getschema Discovery (Lines 1871-1913):
- Added sample data query execution after getschema
- Extracts sample values for each column from
| take 2results - Populates
sample_valueswith actual table data - Includes error handling for sample data retrieval failures
Key Implementation Pattern:
# Get sample data for all columns
sample_data = {}
try:
bracketed_table = bracket_if_needed(table)
sample_query = f"{bracketed_table} | take 2"
sample_result = await self._execute_kusto_async(sample_query, cluster, database, is_mgmt=False)
if sample_result and len(sample_result) > 0:
# Extract sample values for each column
sample_values = [str(row.get(col_name, '')) for row in sample_result[:2]
if row.get(col_name) is not None]
sample_data[col_name] = sample_values
except Exception as sample_error:
logger.debug(f"Failed to get sample data: {sample_error}")π Bug Fixes
Critical Fixes
- Sample Values Population: Fixed bug where Strategy 1 and Strategy 2 weren't fetching actual sample data from tables
- Query Execution: Ensured
| take 2queries execute properly to populate sample values - Error Handling: Added proper error handling for sample data retrieval to prevent schema discovery failures
- Consistency: All three schema discovery strategies now behave identically regarding sample values
Impact
- AI Context: AI models now receive actual data samples for better column understanding
- Query Generation: Improved natural language to KQL query generation with real data context
- Schema Intelligence: Enhanced schema descriptions with actual value examples
π¦ Installation & Upgrade
New Installation
pip install mcp-kql-server==2.0.7Upgrade from Previous Versions
pip install --upgrade mcp-kql-serverπ― Benefits
- Enhanced AI Context: AI models now have access to real sample values for better understanding
- Improved Query Generation: Better natural language to KQL conversion with actual data examples
- Consistent Behavior: All schema discovery strategies now provide complete information
- Better Debugging: Enhanced error messages and logging for troubleshooting
β Quality Assurance
- Schema Discovery: Verified all three strategies now populate sample values correctly
- Query Execution: Confirmed
| take 2queries execute successfully across different tables - Error Handling: Validated proper error handling when sample data retrieval fails
- Backward Compatibility: Changes are fully backward compatible with existing implementations