Skip to main content
Glama

Add Conditional Formatting Rule

add_conditional_format_rule

Add a cell-value conditional formatting rule to an Excel range, applying fill, font, or bold styles when conditions like greater than or between are met. Works on live open workbooks.

Instructions

Add a cell-value conditional formatting rule to a range.

Args: workbook: Workbook name or path (None = active workbook). sheet: Worksheet name (None = active sheet). range_address: A1-style address, e.g. "A1:A20". condition: One of "greater_than", "less_than", "greater_equal", "less_equal", "equal_to", "not_equal", "between", "not_between". value1: Comparison value (required). Numbers or text. value2: Second comparison value, required only for "between"/ "not_between". fill_color: Hex RGB cell fill to apply when the rule matches. font_color: Hex RGB font color to apply when the rule matches. bold: Bold the font when the rule matches.

Returns: JSON with the new rule's index (rules apply in index order).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boldNo
sheetNo
value1No
value2No
workbookNo
conditionNogreater_than
fill_colorNo
font_colorNo
range_addressNoA1
Behavior4/5

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

Annotations provide no safety hints, so the description carries the behavioral burden. It clearly indicates a mutating 'add' operation, describes the return payload (new rule's index), and reveals the ordering behavior ('rules apply in index order'). It could state explicitly that existing rules are preserved, but the add semantics effectively imply non-destructive appending.

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 a well-structured docstring with a clear purpose sentence, an Args block, and a Returns section. It is somewhat long, but every parameter earns its place given the absence of schema descriptions, and the structure makes information easy to scan.

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 9-parameter tool with no output schema and no annotations, the description is remarkably complete. It explains each parameter, the condition enum, parameter dependencies, and the return value, including the important index-order behavior. Nothing critical is missing for an agent to invoke it correctly.

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?

The input schema has 0% parameter descriptions, so the description must compensate. It fully documents all nine parameters, enumerates valid condition values, marks value1 as required, explains value2's conditional requirement, and provides a range format example. This goes well beyond the schema.

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 ('Add') and a clearly defined resource ('cell-value conditional formatting rule') scoped to a range. This distinguishes it from sibling tools like add_color_scale, list_conditional_format_rules, and clear_conditional_format_rules.

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

Usage Guidelines4/5

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

The description provides clear context: it is the tool for adding cell-value conditional formatting rules based on comparison conditions. It does not explicitly name alternatives or exclusions, but the condition list and the 'cell-value' qualifier make the intended use obvious enough for an agent to select it correctly.

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/trustypangolin/excel-mcp-live'

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