Skip to main content
Glama

设置单元格样式

format_cells

Styles a cell range in an Excel sheet by setting font, fill color, borders, alignment, and number format—only modifying properties you specify while leaving others unchanged.

Instructions

设置一个区域的字体、填充色、边框、对齐、数字格式,让表格好看。只传想改的项,没传的不动。csv 文件不支持样式。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangeYes矩形区域,如 `A1:D20`
styleYes
filePathYesExcel 文件的绝对路径,例如 `C:\Users\xx\报表.xlsx` 或 `/Users/xx/报表.xlsx`。支持 .xlsx / .xls / .csv
sheetNameYes
Behavior3/5

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

No annotations are provided, so the description carries the transparency burden. It discloses the partial-update behavior (only passed fields are changed) and the csv limitation, which is useful. However, it doesn't disclose what happens to existing styles, whether the operation is reversible, any formatting constraints (e.g., color format expectations like hex vs names), or any side effects. For a mutation tool on files, some risk disclosure would help, but the description covers the most important behavioral aspects.

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?

Three short sentences, each earning its place: the purpose, the key partial-update rule, and the csv limitation. Front-loaded with the verb+resource purpose, then trailing with usage-critical caveats. Zero waste.

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?

This is a moderate-complexity tool with 4 params and nested style objects. The description explains the partial-update semantics and csv constraint, which are the two most important behavioral aspects. The nested style schema is self-documenting, and there's no output schema to worry about. It could benefit from noting color format examples or what 'style' default behavior is, but overall it's reasonably complete for a formatting tool.

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 50%, so the description partially compensates by enumerating what style categories can be set (font, fill, border, alignment, number format) and explaining the partial-update semantics. It adds the 'don't pass what you don't want to change' meaning beyond the raw schema. However, it doesn't explain color format requirements (hex?) or the nested structure specifics, though the nested style schema is fairly self-explanatory.

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 clearly states the verb 'set' + specific resource (cell styling for font, fill, border, alignment, number format), with a clear purpose of making spreadsheets look better. It distinguishes from sibling tools—none of the read/write/data manipulation siblings handle visual formatting, so this is uniquely positioned.

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?

It explicitly states a key usage rule: '只传想改的项,没传的不动' (only pass what you want to change; unpassed items are untouched), which is critical usage guidance for partial style updates. It also mentions that csv files don't support styles, which is a proper exclusion/limitation note. It doesn't explicitly name alternative tools for when-to-not-use, but the purpose is distinct enough that this isn't a major gap.

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

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