Feishu Sheets (Fixed) — Feishu 表格(修复)
v2Feishu 在线电子表格(Sheets)操作,包括创建、读取、写入、追加数据、管理工作表。当用户提到 Feishu Sheets、在线电子表格、电子表格(不包括 Bitable/多维表格)时使用。支持:创建电子表格、写入/读取单元格值、追加行、插入/删除行/列、管理工作表。
运行时依赖
安装命令
点击复制技能文档
Feishu Sheets 工具 单个工具 feishu_sheets,具有用于所有电子表格操作的 action 参数。 从 URL 中提取 Token https://xxx.feishu.cn/sheets/shtABC123 → spreadsheet_token = shtABC123
操作 创建电子表格 { "action": "create", "title": "新建电子表格" } 可选文件夹: { "action": "create", "title": "新建电子表格", "folder_token": "fldcnXXX" } 返回:spreadsheet_token、url、title
写入值 { "action": "write", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx", "range": "A1:C3", "values": [["姓名", "年龄", "城市"], ["Alice", 25, "北京"], ["Bob", 30, "上海"]] }
读取值 { "action": "read", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx", "range": "A1:C10" }
追加值 { "action": "append", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx", "values": [["Charlie", 28, "深圳"]] }
插入行/列 { "action": "insert_dimension", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx", "dimension": "ROWS", "start_index": 5, "end_index": 7 }
删除行/列 { "action": "delete_dimension", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx", "dimension": "ROWS", "start_index": 5, "end_index": 7 }
获取电子表格信息 { "action": "get_info", "spreadsheet_token": "shtABC123" } 返回:包含所有 sheet_ids 和标题的元数据
添加工作表 { "action": "add_sheet", "spreadsheet_token": "shtABC123", "title": "Sheet2" }
删除工作表 { "action": "delete_sheet", "spreadsheet_token": "shtABC123", "sheet_id": "0bxxxx" }
范围 格式单元格:A1、B5 范围:A1:C10、B2:D5 整个列:A:A、B:D 整个行:1:1、3:5 带 sheet_id:0bxxxx!A1:C10
从 URL 中获取 sheet_id: https://xxx.feishu.cn/sheets/shtABC123?sheet=0bxxxx 从 get_info 操作中获取
数据类型 值可以是: 字符串: "Hello" 数字:123、45.67 公式:{"type": "formula", "text": "=SUM(A1:A10)"} 链接:{"type": "url", "text": "点击这里", "link": "https://..."}
配置 channels: feishu: tools: sheets:true # 默认:true
所需权限 sheets:spreadsheet - 创建和管理电子表格 sheets:spreadsheet:readonly - 读取电子表格数据 drive:drive - 访问云存储
API 参考 基础 URL:https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/ 请参阅 references/api-reference.md 以获取详细的 API 文档。