Skip to main content
Glama
Google Workspace MCP Server

Google Workspace MCP Server

by akilja24

add_conditional_formatting

Add conditional formatting rules to Google Sheets ranges so cells automatically change background or text color when conditions match.

Instructions

Adds a conditional formatting rule to a range.

Args: user_google_email (str): The user's Google email address. Required. spreadsheet_id (str): The ID of the spreadsheet. Required. range_name (str): A1-style range (optionally with sheet name). Required. condition_type (str): Sheets condition type (e.g., NUMBER_GREATER, TEXT_CONTAINS, DATE_BEFORE, CUSTOM_FORMULA). condition_values (Optional[Union[str, List[Union[str, int, float]]]]): Values for the condition; accepts a list or a JSON string representing a list. Depends on condition_type. background_color (Optional[str]): Hex background color to apply when condition matches. text_color (Optional[str]): Hex text color to apply when condition matches. rule_index (Optional[int]): Optional position to insert the rule (0-based) within the sheet's rules. gradient_points (Optional[Union[str, List[dict]]]): List (or JSON list) of gradient points for a color scale. If provided, a gradient rule is created and boolean parameters are ignored.

Returns: str: Confirmation of the added rule.

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>",
      "range_name": "<range_name>",
      "condition_type": "<condition_type>"
    },
    "name": "add_conditional_formatting"
  }
}

Input Schema

NameRequiredDescriptionDefault
range_nameYes
rule_indexNo
text_colorNo
condition_typeYes
spreadsheet_idYes
gradient_pointsNo
background_colorNo
condition_valuesNo
user_google_emailYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.13.1

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose that the return is a confirmation string and that gradient_points supersedes other rule parameters, but it never states auth/permission requirements, what happens to existing rules at rule_index, failure modes for invalid condition_type/color values, or whether the write is idempotent. For a mutation tool with zero annotation coverage, those omissions are significant.

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

Conciseness4/5

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

Front-loaded with a one-sentence purpose statement, then a scannable parameter list. Some waste comes from restating Python type signatures (Optional[Union[str, List[...]]]) that merely duplicate the JSON schema, but each parameter sentence otherwise adds usable meaning.

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

Completeness3/5

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

Output schema exists, so return-value explanation is not required, and the parameter surface is well covered. What is missing for a 9-parameter mutation tool with no annotations is the operational envelope: permission requirements, error behavior, and interaction between gradient_points and the color parameters beyond a single clause.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it largely does: all 9 parameters are explained, including A1 range format, condition_type examples (NUMBER_GREATER, TEXT_CONTAINS, DATE_BEFORE, CUSTOM_FORMULA), the list-or-JSON-string dual accepted by condition_values and gradient_points, 0-based rule_index semantics, and the dependency of condition_values on condition_type. It falls short only in not enumerating the full set of legal condition_type values or hex color format expectations.

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

Purpose4/5

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

Clear specific verb+resource: 'Adds a conditional formatting rule to a range.' The agent knows exactly what is created and where. It does not, however, distinguish this from the sibling tools update_conditional_formatting and delete_conditional_formatting operating on the same resource.

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

Usage Guidelines2/5

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

No statement of when to use this versus update_conditional_formatting or delete_conditional_formatting, and no prerequisites or preconditions given. The only routing-like signal is the internal note that supplying gradient_points switches to a gradient rule and ignores boolean parameters, which is behavioral rather than use-case guidance.

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

Deploy Server

Other Tools