Skip to main content
Glama

Manage conditional formatting

manage_conditional_formats
Destructive

Add, update, or delete conditional formatting rules in Google Sheets to automatically style cells when conditions like text, numbers, or custom formulas are met.

Instructions

Manages conditional-format rules that style cells when a condition holds (boolean rules; gradient color scales need raw_request). Rules are addressed by SHEET + INDEX in that sheet's rule list — get current rules and indexes from get_spreadsheet (sheets[].conditionalFormats), and re-read after every mutation because add/delete shift later indexes. action=add inserts a rule at index (default 0 = highest priority; rules are evaluated in order and the first match wins): needs ranges, condition_type (+condition_values; CUSTOM_FORMULA with a "=..." formula is the most flexible) and at least one format field (background_color, text_color, bold, italic). action=update replaces the ENTIRE rule at sheet_id+index with the newly provided one. action=delete removes the rule at sheet_id+index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNoBold text for matching cells.
indexNoRule position in the sheet's list. add: insert position (default 0); update/delete: required.
actionYesWhat to do with the rules.
italicNoItalic text for matching cells.
rangesNoadd/update: the cells the rule applies to.
sheet_idNoupdate/delete: the sheet whose rule list is addressed.
text_colorNoText color for matching cells, "#RRGGBB".
condition_typeNoSheets API condition type, e.g. ONE_OF_LIST, ONE_OF_RANGE, NUMBER_GREATER, NUMBER_LESS, NUMBER_BETWEEN, NUMBER_EQ, TEXT_CONTAINS, TEXT_STARTS_WITH, TEXT_EQ, TEXT_IS_EMAIL, DATE_AFTER, DATE_BEFORE, DATE_BETWEEN, DATE_IS_VALID, BLANK, NOT_BLANK, BOOLEAN, CUSTOM_FORMULA.
spreadsheet_idYesThe spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output.
background_colorNoFill for matching cells, "#RRGGBB".
condition_valuesNoCondition arguments: list items for ONE_OF_LIST (["Yes","No"]), one number for NUMBER_GREATER (["100"]), two for NUMBER_BETWEEN, "=A1>B1"-style formula for CUSTOM_FORMULA and ONE_OF_RANGE ("=Sheet1!A1:A10"), relative dates as values. Omit for BLANK / NOT_BLANK / DATE_IS_VALID.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Even though annotations already indicate destructive and non-read-only behavior, the description adds meaningful operational detail: first-match-wins evaluation, highest-priority default index 0, update replacing the ENTIRE rule, and index shifting after mutations. This goes well beyond what annotations or schema express.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but every sentence earns its place. It front-loads the core addressing model, then systematically covers add/update/delete semantics without filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 11-parameter mutation tool with no output schema, the description covers addressing, state sourcing, side effects, action-specific requirements, condition types, formula usage, and required format fields. Nothing essential for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description still adds significant semantic value by specifying action-dependent requirements: add needs ranges, condition_type, condition_values, and at least one format field; update/delete require sheet_id + index; CUSTOM_FORMULA needs a '=...' formula; index defaults to 0 for add. This is a strong enhancement over raw schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Manages conditional-format rules that style cells when a condition holds.' It immediately scopes the tool to boolean rules and explicitly routes gradient color scales to raw_request, distinguishing it from siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives concrete usage context: rules are addressed by sheet + index, current rules are read from get_spreadsheet, and indexes must be re-read after every mutation because add/delete shift later indexes. It also names raw_request as the alternative for gradient color scales, providing clear routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-sheets'

If you have feedback or need assistance with the MCP directory API, please join our Discord server