add_data_validation
Apply data validation rules to cell ranges for input restrictions and data quality control, supporting types like lists, numbers, dates, and custom formulas.
Instructions
Add data validation rules to a cell range for input restrictions and data quality control
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": {
"spreadsheet_id": "<spreadsheet_id>",
"sheet_name": "<sheet_name>",
"range": "<range>",
"validation_type": "<validation_type>"
},
"name": "add_data_validation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | Range to apply validation (e.g., "A1:A10", "B2:D5") | |
| strict | No | If true, reject invalid input. If false, show warning only | |
| values | No | Values for validation (list items, numbers, dates, formula) | |
| sheet_name | Yes | Name of the sheet | |
| error_message | No | Optional custom error message for invalid input | |
| input_message | No | Optional help text shown when cell is selected | |
| spreadsheet_id | Yes | Google Spreadsheet ID | |
| validation_type | Yes | Type of validation rule |