消息管理工具
本文档详细介绍消息相关的工具使用方法。
工具列表
| 工具 | 功能 | 必填参数 |
|---|---|---|
| feishu_im_user_get_messages | 获取群聊/私聊历史消息 | chat_id 或 open_id |
| feishu_im_user_get_thread_messages | 获取话题内回复 | thread_id |
| feishu_im_user_search_messages | 跨会话搜索消息 | 至少一个过滤条件 |
| feishu_im_user_fetch_resource | 下载图片/文件 | message_id, file_key, type |
使用场景
获取群聊历史消息
json
{
"action": "list",
"chat_id": "oc_xxxxx",
"relative_time": "this_week",
"page_size": 50
}获取私聊消息
json
{
"action": "list",
"open_id": "ou_xxxxx",
"start_time": "2026-02-01T00:00:00+08:00",
"end_time": "2026-02-28T23:59:59+08:00"
}搜索消息
json
{
"action": "list",
"query": "关键词",
"sender_ids": ["ou_xxxxx"],
"chat_type": "group"
}下载图片
json
{
"message_id": "om_xxxxx",
"file_key": "img_xxxxx",
"type": "image"
}时间过滤
支持两种方式:
相对时间
| 值 | 说明 |
|---|---|
| today | 今天 |
| yesterday | 昨天 |
| this_week | 本周 |
| last_week | 上周 |
| last_3_days | 最近3天 |
精确时间
json
{
"start_time": "2026-02-01T00:00:00+08:00",
"end_time": "2026-02-28T23:59:59+08:00"
}分页说明
page_size范围:1-50,默认 50- 返回
has_more: true时,使用page_token获取下一页