read_messages
Read message history from any Feishu group using chat ID, numeric ID, or name. Automatically resolves sender names, expands merged forwards, and extracts URLs and doc links for direct use.
Instructions
[Official API + UAT fallback] Read message history from any group. Accepts oc_xxx ID, numeric ID, or chat name (auto-searched). Auto-falls back to UAT for external groups the bot cannot access. Returns newest messages first by default, with sender names resolved. Auto-expands merge_forward messages into their child messages (with original sender / time / content preserved) by default — disable with expand_merge_forward=false. Text messages have URLs extracted into urls; Feishu doc links are additionally surfaced as feishuDocs so agents can feed them straight into read_doc / get_doc_blocks.
Sender semantics (v1.3.12): each message has a displayLabel (e.g. 周宇, [Bot] Claude聊天助手, [匿名], [系统], [已撤回] 怪兽) — prefer it over raw senderId when narrating who-said-what. Also surfaced: senderType (user|app|anonymous), senderIdType (open_id|union_id|user_id), senderTenantKey, isExternal (cross-tenant), isRecalled, isThreadReply (parent_id present). merge_forward children carry originChatId (the chat the conversation came from, NOT the chat you queried) and best-effort forwardedFromChatName — do NOT treat children as native messages of the current group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Chat ID (oc_xxx), numeric ID, or chat name (auto-searched via bot groups, im.chat.search, and user contacts) | |
| end_time | No | End timestamp in seconds (optional) | |
| via_user | No | v1.3.12 — explicit identity override. `true` skips the bot path and reads directly via UAT (use when the chat is yours / external and you know bot has no access). `false` skips UAT fallback and surfaces the bot error instead of cross-identity hop (use when you specifically want the bot view). Omit for default auto-fallback (bot first, UAT on failure). | |
| page_size | No | Messages to fetch (default 20, max 50) | |
| sort_type | No | Sort order (default: ByCreateTimeDesc = newest first) | |
| page_token | No | Pagination cursor — pass the pageToken from a previous response to fetch the next (older) page when hasMore is true. | |
| start_time | No | Start timestamp in seconds (optional) | |
| expand_merge_forward | No | Auto-expand merge_forward placeholders into their child messages (default true). Children carry parentMessageId; use that id (not the child id) with download_message_resource (kind=image or file). |