Skip to content

Messaging Tools

This document details the messaging tools.

Tool List

ToolFunctionRequired Params
feishu_im_user_get_messagesGet group/DM historychat_id or open_id
feishu_im_user_get_thread_messagesGet thread repliesthread_id
feishu_im_user_search_messagesCross-session searchAt least one filter
feishu_im_user_fetch_resourceDownload images/filesmessage_id, file_key, type

Usage Examples

Get Group Chat History

json
{
  "action": "list",
  "chat_id": "oc_xxxxx",
  "relative_time": "this_week",
  "page_size": 50
}

Get Private Messages

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"
}

Search Messages

json
{
  "action": "list",
  "query": "keyword",
  "sender_ids": ["ou_xxxxx"],
  "chat_type": "group"
}

Download Image

json
{
  "message_id": "om_xxxxx",
  "file_key": "img_xxxxx",
  "type": "image"
}

Time Filtering

Relative Time

ValueDescription
todayToday
yesterdayYesterday
this_weekThis week
last_weekLast week
last_3_daysLast 3 days

Exact Time

json
{
  "start_time": "2026-02-01T00:00:00+08:00",
  "end_time": "2026-02-28T23:59:59+08:00"
}

Pagination

  • page_size range: 1-50, default 50
  • When has_more: true, use page_token to get next page

Released under the MIT License.