统一使用 feishu_sheets 工具,通过 action 参数区分不同的表格操作。
从 URL 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_id 和标题
{
"action": "add_sheet",
"spreadsheet_token": "shtABC123",
"title": "Sheet2"
}
{
"action": "delete_sheet",
"spreadsheet_token": "shtABC123",
"sheet_id": "0bxxxx"
}
A1、B5A1:C10、B2:D5A:A、B:D1:1、3:50bxxxx!A1:C10https://xxx.feishu.cn/sheets/shtABC123?sheet=0bxxxx0bxxxx支持的值类型:
"你好"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 - 访问云空间基础 URL:https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/
详细 API 文档请参阅 references/api-reference.md。
共 1 个版本