manage_conditional_formatting
Add, update, or delete conditional formatting rules in Google Sheets to automatically highlight cells based on data values or formulas.
Instructions
Manages conditional formatting rules on a Google Sheet. Supports adding, updating, and deleting conditional formatting rules via a single tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | The user's Google email address. Required. | |
| spreadsheet_id | Yes | The ID of the spreadsheet. Required. | |
| action | Yes | The operation to perform. Must be one of "add", "update", or "delete". | |
| range_name | No | A1-style range (optionally with sheet name). Required for "add". Optional for "update" (preserves existing ranges if omitted). Not used for "delete". | |
| condition_type | No | Sheets condition type (e.g., NUMBER_GREATER, TEXT_CONTAINS, DATE_BEFORE, CUSTOM_FORMULA). Required for "add". Optional for "update" (preserves existing type if omitted). | |
| condition_values | No | Values for the condition; accepts a list or a JSON string representing a list. Depends on condition_type. Used by "add" and "update". | |
| background_color | No | Hex background color to apply when condition matches. Used by "add" and "update". | |
| text_color | No | Hex text color to apply when condition matches. Used by "add" and "update". | |
| rule_index | No | 0-based index of the rule. For "add", optionally specifies insertion position. Required for "update" and "delete". | |
| gradient_points | No | List (or JSON list) of gradient points for a color scale. If provided, a gradient rule is created and boolean parameters are ignored. Used by "add" and "update". | |
| sheet_name | No | Sheet name to locate the rule when range_name is omitted. Defaults to the first sheet. Used by "update" and "delete". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |