Skip to main content
Glama
lubo3395
by lubo3395

更新 Excel 单元格

xlsx_update_cells
Destructive

Update cell values in a given sheet of an xlsx file. Specify file path, sheet name or index, and a JSON object mapping cell references to new values.

Instructions

更新 xlsx 文件中指定 sheet 的单元格值。

参数:

  • file_path (string, 必填): xlsx 文件路径

  • sheet (string|number, 必填): sheet 名称或索引 (从 0 开始)

  • cells (string, 必填): 要更新的单元格,JSON 对象格式: {"A1": "值", "B2": 123, "C3": true}

返回:

  • file_path: 文件路径

  • sheet: 更新的 sheet

  • updated: 更新单元格数量

示例:

  • "把 test.xlsx 的 Sheet1 中 A1 改成 Hello" -> { file_path: "test.xlsx", sheet: "Sheet1", cells: '{"A1": "Hello"}' }

  • "批量修改多个单元格" -> { file_path: "test.xlsx", sheet: 0, cells: '{"A1": "标题", "B1": "值"}' }

错误处理:

  • cells 格式无效: "cells 格式无效: ..."

  • 单元格引用无效: "单元格引用无效: ..."

  • sheet 不存在: "Sheet ... 不存在"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesxlsx 文件路径
sheetYessheet 名称或索引 (从 0 开始)
cellsYes要更新的单元格, JSON 对象格式: {"A1": "值", "B2": 123}
Behavior2/5

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

The annotations already indicate destructiveHint=true and readOnlyHint=false. The description adds little beyond that—it states '更新' which is consistent with mutation, but does not disclose additional behavioral traits such as authorization needs, side effects on other cells, or file state changes. No contradiction with annotations.

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 clear sections for parameters, return, example, and error handling. It is efficient, front-loading the main purpose. However, it could be slightly more concise by reducing repetition of parameter names already in schema.

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 has 3 parameters, no output schema, but with annotations present, the description covers all parameters with examples and error cases. It provides enough context for an agent to use the tool effectively, though it lacks usage guidelines and behavioral details.

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 coverage is 100%, so baseline is 3. The description adds value by providing example usage (including JSON format for cells), returning structure, and error handling for invalid cells or sheet. This goes beyond the schema's simple type descriptions.

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 it updates cell values in a specified sheet, with specific verb '更新' and resource 'xlsx 文件中指定 sheet 的单元格值'. It is distinct from sibling tools like xlsx_read (read), xlsx_create (create), xlsx_add_sheet (add sheet), and xlsx_list_sheets (list sheets).

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 when not to use it or under what conditions. No context about prerequisites or ideal scenarios.

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/lubo3395/mcp-xlsx-server'

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