Skip to main content
Glama

add_conditional_format

Apply conditional formatting rules (data bars, color scales, threshold comparisons, duplicates) to specified cell ranges in Excel files.

Instructions

添加条件格式(openpyxl 原生规则,真实生效)。

cond_type 可选:

  • data_bar:数据条(无需 value)

  • color_scale:色阶(无需 value)

  • greater_than / less_than / equal:需要 value

  • between:需要 value 与 value2

  • duplicate:高亮重复值(无需 value)

参数:

  • cell_range:作用区域,如 "C2:C100"

  • value / value2:阈值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheetNo
valueNo
value2No
cond_typeYes
file_pathYes
cell_rangeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It states the tool uses openpyxl native rules and that they 'actually take effect,' which is helpful behavioral context. However, it doesn't disclose side effects like whether existing conditional formats are overwritten, whether the file is saved, or error conditions (e.g., invalid cell_range). It's adequate but not comprehensive.

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?

The description is well-structured with a clear list of cond_type options and a brief parameters section. It's concise and front-loads the core info. The only minor redundancy is the '参数' list repeating some info already in the cond_type section, but it's not wasteful.

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

Completeness4/5

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

Given the tool's moderate complexity (6 params, 5 cond_type values), the description covers the essential logic for each type and gives examples. It lacks details on return values (but no output schema exists) and edge cases, but for an agent to invoke it correctly with the required parameters, it's largely sufficient. A perfect score would require more on error handling or effects.

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. It does well by explaining the purpose of each cond_type and linking them to the value/value2 parameters (e.g., 'between' requires value and value2). It also gives an example for cell_range. This adds significant meaning beyond the bare property names in the schema.

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?

The description states it adds conditional formatting with openpyxl native rules and lists specific rule types, which clearly shows the tool's purpose. It's distinct from sibling tools like list_conditional_formats (which lists existing formats) and set_number_format (which sets number formats). However, it doesn't explicitly differentiate from all siblings, but the verb 'add' and resource 'conditional format' are specific enough.

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

Usage Guidelines3/5

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

The description gives clear guidance on when each cond_type is appropriate (e.g., which types require value, value2). However, there's no explicit mention of when to use this tool versus alternatives like list_conditional_formats or revert_last_write, nor are there exclusions or prerequisites. The context is implied but not fully spelled out.

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