files_set_custom_validation
Adds a custom formula validation to a range — Excel's "Custom" data-validation type: the value is accepted when the formula evaluates to TRUE. Write the formula for the top-left cell of the range; relative references shift for every other cell, as in Excel. The formula sees the value being entered, so "=A1>0" on A1:A10 rejects a negative number as it is typed. strict (default true): reject invalid entries; false warns. Pass 'id' (from files_validations) to replace. Requires edit permission. Signature: files_set_custom_validation(file_uuid, range, formula, sheet?, id?, strict?, ignore_blank?).
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_uuid": "<file_uuid>",
"range": "<range>",
"formula": "<formula>"
},
"name": "files_set_custom_validation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Existing validation id to replace; omit to create a new one. | |
| range | Yes | A1 range the rule applies to, e.g. 'B2:B100'. | |
| sheet | No | Sheet name (defaults to the first sheet). | |
| strict | No | true (default) rejects invalid entries; false only warns. | |
| formula | Yes | Formula that must be TRUE for the value to pass, e.g. '=AND(A1>0,A1<100)'. Written for the top-left cell of the range; English and Russian notation are both accepted, as in files_set_formula. | |
| file_uuid | Yes | ||
| ignore_blank | No | true (default) lets empty cells pass. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | ||
| file_uuid | Yes | ||
| sequence_number | Yes |