Skip to main content
Glama
lubo3395
by lubo3395

添加 Sheet 到 Excel

xlsx_add_sheet
Destructive

Add a new sheet to an existing xlsx file by providing the file path, JSON data, and a unique sheet name.

Instructions

向已有的 xlsx 文件中添加新的 sheet。

参数:

  • file_path (string, 必填): 已存在的 xlsx 文件路径

  • data (string, 必填): JSON 数据字符串 (同 xlsx_create 的 data 参数)

  • sheet_name (string, 必填): 新 sheet 名称 (不能与已有 sheet 重名)

返回:

  • file_path: 文件路径

  • sheet_name: 新 sheet 名称

  • rows: 数据行数

  • cols: 数据列数

  • sheets: 更新后的所有 sheet 名称列表

示例:

  • "往 test.xlsx 添加一个名为 成绩表 的 sheet" -> { file_path: "test.xlsx", data: '[{"姓名":"张三","成绩":90}]', sheet_name: "成绩表" }

错误处理:

  • Sheet 名称已存在: "Sheet "名称" 已存在。可用 ..."

  • 文件不存在: "文件不存在: ..."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes已存在的 xlsx 文件路径
dataYesJSON 数据: 可以是对象数组或二维数组
sheet_nameYes新 sheet 名称 (不能与已有 sheet 重名)
Behavior3/5

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

Annotations indicate destructiveHint=true, consistent with adding a sheet. The description adds value by describing error conditions and return values, but does not disclose additional behavioral traits beyond what annotations provide. Moderate extra context.

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 well-structured: purpose first, then parameter details, return values, example, error handling. Front-loaded with main action, no unnecessary sentences.

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 3 required parameters and no output schema, the description covers return fields and errors. It is fairly complete but could provide slightly more detail on data JSON format constraints. Overall adequate.

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% and descriptions for parameters already exist. The description adds cross-reference to xlsx_create's data parameter and clarifies data format (object array or 2D array). This adds useful meaning 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 clearly states the action (add a new sheet) and the resource (existing xlsx file), and distinguishes it from siblings like xlsx_create (which creates new files) and xlsx_list_sheets (which lists sheets). Specific verb+resource+scope.

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 specifies the tool adds sheets to existing files, implicitly differentiating from xlsx_create. It provides examples and error messages for duplicate names and missing files, giving context on when to use. However, it does not explicitly state when not to use or name alternatives.

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