把用户发来的附件下载到本地
feishu_downloadDownloads files or images from a Feishu message to local disk and returns the absolute path, enabling scripts or workflows to process the attachment. Resolves missing file keys from message content.
Instructions
下载某条飞书消息里的附件(文件或图片)到本地磁盘,返回绝对路径,之后就能用 bash/脚本处理它。典型链路:用户发来一个 docx → 本工具下载 → 本地解析/改写 → feishu_send_file 发回。不传 file_key 时会自动从消息 content 里取(file_key 或 image_key);落盘名优先用消息里自带的名字,没有就用 _<fileKey前8位>.<后缀>,同名文件自动加 -1 后缀不覆盖。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"message_id": "<message_id>"
},
"name": "feishu_download"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | 资源类型,默认 file;图片消息不填时自动按 image 下载 | |
| dest_dir | No | 落盘目录,默认 ./downloads(相对当前工作目录,内部会 path.resolve) | |
| file_key | No | 资源 key;不填则从消息 content 里自动识别 file_key / image_key | |
| message_id | Yes | 消息 id(om_ 开头),从 feishu_recent 之类的结果里拿 |