update_conditional_formatting
Update an existing conditional formatting rule by index on a Google Sheets sheet, changing ranges, conditions, colors, or gradients; preview the planned change with dry-run.
Instructions
Updates an existing conditional formatting rule by index on a sheet.
Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (Optional[str]): A1-style range to apply the updated rule (optionally with sheet name). If omitted, existing ranges are preserved. rule_index (int): Index of the rule to update (0-based). condition_type (Optional[str]): Sheets condition type. If omitted, the existing rule's type is preserved. condition_values (Optional[Union[str, List[Union[str, int, float]]]]): Values for the condition. background_color (Optional[str]): Hex background color when condition matches. text_color (Optional[str]): Hex text color when condition matches. sheet_name (Optional[str]): Sheet name to locate the rule when range_name is omitted. Defaults to first sheet. gradient_points (Optional[Union[str, List[dict]]]): If provided, updates the rule to a gradient color scale using these points. dry_run (bool): When True (default), return planned update details without mutating the sheet.
Returns: str: Confirmation of the updated rule and the current rule state.
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": {
"user_google_email": "<user_google_email>",
"spreadsheet_id": "<spreadsheet_id>",
"rule_index": "<rule_index>"
},
"name": "update_conditional_formatting"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| range_name | No | ||
| rule_index | Yes | ||
| sheet_name | No | ||
| text_color | No | ||
| condition_type | No | ||
| spreadsheet_id | Yes | ||
| gradient_points | No | ||
| background_color | No | ||
| condition_values | No | ||
| user_google_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |