mcp-gsheetsTools Reference
sheets_add_conditional_formatting
Add conditional formatting rules
sheets_add_conditional_formatting
Add conditional formatting rules to highlight cells based on their values.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
spreadsheetId | string | Yes | The spreadsheet ID |
range | string | Yes | A1 notation range |
rule | object | Yes | Conditional formatting rule |
Example
{
"tool": "sheets_add_conditional_formatting",
"arguments": {
"spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
"range": "Sheet1!B2:B100",
"rule": {
"type": "NUMBER_GREATER",
"values": [100],
"format": {
"backgroundColor": { "red": 0.8, "green": 1, "blue": 0.8 }
}
}
}
}Rule Types
NUMBER_GREATER, NUMBER_LESS, TEXT_CONTAINS, CUSTOM_FORMULA