Skip to main content
Glama

set_number_format

Apply built-in or custom number formats to a specified cell range in an Excel file, converting values to currency, percent, integer, date, or other displays.

Instructions

设置数字格式。

number_format 可传内置名或自定义格式码:

  • cny → ¥#,##0(人民币整数)

  • cny2 → ¥#,##0.00

  • cny_dash → ¥#,##0;(¥#,##0);-(零显示为短横)

  • percent → 0.0%(注意:值必须存小数,存 0.15 显示 15.0%)

  • multiple → 0.0x(估值倍数)

  • int → #,##0;date → yyyy-mm-dd

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheetNo
file_pathYes
cell_rangeYes
number_formatYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It does add useful behavioral details, such as the requirement that percent values must be stored as decimals (0.15 displays as 15.0%) and that cny_dash displays zero as a dash. However, it does not disclose whether existing formatting is overwritten, how invalid custom codes are handled, or what the function returns after success.

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 compact and front-loaded with the core purpose, followed by a clean mapping of format codes to their meanings. The list is easy to scan, though a small amount of structure could be improved by separating the int and date mappings onto their own lines.

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?

The description provides enough information to select valid values for the main parameter, but it omits important contextual details for a mutating tool: whether it saves to the file, overwrites existing formatting, handles custom format code syntax, or what it returns. Since there are no annotations and no output schema, these gaps make it less than fully complete.

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 thoroughly documents the number_format parameter, including exact code strings and display behavior, which is especially valuable because the schema has no enums or descriptions for that parameter. The other parameters (file_path, cell_range, sheet) are left implicit, but their names are reasonably self-explanatory in this spreadsheet context.

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 clearly states the tool sets number formats, and the detailed list of built-in format codes clarifies exactly what kind of formatting is supported. It does not explicitly mention the target resource (file/cell range), but the schema and naming make that evident, and it is distinct from sibling tools like write_cells and apply_chinese_style.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention exclusions, prerequisites, or how it relates to sibling tools like write_cells or apply_chinese_style, leaving the agent to infer the appropriate context.

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