mirror of
https://github.com/haris-musa/excel-mcp-server.git
synced 2025-12-08 17:12:41 +08:00
feat(cell validation): add comprehensive data validation capabilities (#37)
- Add cell_validation.py module for Excel data validation metadata extraction - Implement get_data_validation_for_cell() and get_all_validation_ranges() - Include validation metadata in read_data_from_excel responses automatically - Add get_data_validation_info MCP tool for validation rule summaries - Resolve range references in list validations to actual cell values - Support all validation types: list, whole, decimal, date, time, textLength - Include operators (between, notBetween, equal, greaterThan, etc.) in metadata This allows LLMs to understand Excel validation constraints including dropdown options, numeric ranges, date constraints, and text length limits.
This commit is contained in:
20
TOOLS.md
20
TOOLS.md
@ -337,3 +337,23 @@ validate_excel_range(
|
||||
- `start_cell`: Starting cell of range
|
||||
- `end_cell`: Optional ending cell of range
|
||||
- Returns: Validation result message
|
||||
|
||||
### get_data_validation_info
|
||||
|
||||
Get data validation rules and metadata for a worksheet.
|
||||
|
||||
```python
|
||||
get_data_validation_info(filepath: str, sheet_name: str) -> str
|
||||
```
|
||||
|
||||
- `filepath`: Path to Excel file
|
||||
- `sheet_name`: Target worksheet name
|
||||
- Returns: JSON string containing all data validation rules with metadata including:
|
||||
- Validation type (list, whole, decimal, date, time, textLength)
|
||||
- Operator (between, notBetween, equal, greaterThan, lessThan, etc.)
|
||||
- Allowed values for list validations (resolved from ranges)
|
||||
- Formula constraints for numeric/date validations
|
||||
- Cell ranges where validation applies
|
||||
- Prompt and error messages
|
||||
|
||||
**Note**: The `read_data_from_excel` tool automatically includes validation metadata for individual cells when available.
|
||||
|
||||
Reference in New Issue
Block a user