add_data_validation
Apply data validation rules to Excel ranges to restrict or guide cell input using lists, number, date, text length, or custom criteria.
Instructions
Add a data validation rule to a range (list, whole number, decimal, date, text length, custom).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"sheet": "<sheet>",
"range": "<range>",
"type": "<type>",
"formulae": "<formulae>"
},
"name": "add_data_validation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Validation type | |
| error | No | Error popup message | |
| range | Yes | Range to apply validation (e.g. 'A1:A100') | |
| sheet | Yes | Sheet name or 1-based index | |
| prompt | No | Input hint message | |
| formulae | Yes | Validation formulae (e.g. ['"Yes,No"'] for list, ['1','100'] for range) | |
| operator | No | Comparison operator | |
| file_path | Yes | Absolute path to the .xlsx file | |
| allow_blank | No | Allow blank cells | |
| error_title | No | Error popup title | |
| prompt_title | No | Input hint title | |
| show_error_message | No | Show error popup | |
| show_input_message | No | Show input hint |