Skip to main content
Glama
lubo3395
by lubo3395

创建 Excel 文件

xlsx_create
Destructive

Create Excel xlsx files from JSON data. Supports object arrays or two-dimensional arrays for rows and columns, with configurable sheet name and file overwrite.

Instructions

从 JSON 数据创建新的 xlsx 文件。

参数:

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

  • data (string, 必填): JSON 数据字符串

    • 对象数组格式: [{"姓名": "张三", "年龄": 30}, {"姓名": "李四", "年龄": 25}]

    • 二维数组格式: [["姓名", "年龄"], ["张三", 30], ["李四", 25]]

  • sheet_name (string, 默认 "Sheet1"): sheet 名称

  • overwrite (boolean, 默认 false): 文件已存在时是否覆盖

返回:

  • file_path: 输出文件路径

  • sheet_name: sheet 名称

  • rows: 总行数

  • cols: 总列数

示例:

  • "创建 test.xlsx,包含 [{name:'张三',age:30},{name:'李四',age:25}]" -> { file_path: "test.xlsx", data: '[{"name":"张三","age":30},{"name":"李四","age":25}]' }

  • "覆盖已有文件" -> { file_path: "test.xlsx", data: "...", overwrite: true }

错误处理:

  • 文件已存在且未设置 overwrite: "文件已存在: ..."

  • 输出目录不存在: "输出目录不存在: ..."

  • 数据格式无效: "数据格式无效: ..."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes输出 xlsx 文件路径
dataYesJSON 数据: 可以是对象数组 [{"col1":"val1",...}] 或二维数组 [["h1","h2"],["v1","v2"]]
sheet_nameNosheet 名称Sheet1
overwriteNo如果文件已存在是否覆盖

Tool Definition Quality

Score is being calculated. Check back soon.

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