search_messages
Search Feishu IM history by keyword to find message pointers. Filter by chats, senders, @mentions, or message types, then use read_messages to retrieve full content.
Instructions
[User UAT, v1.3.12] Search the user's IM history by keyword. Wraps Feishu POST /open-apis/search/v2/message. Requires UAT with the search:message scope (re-run npx feishu-user-plugin oauth after v1.3.12 SCOPES update). Feishu does NOT expose a bot-path search; if you only have app credentials this tool will error.
Returns {items, pageToken, hasMore} where each item is a {message_id, chat_id, ...} pointer — call read_messages(chat_id) or read_p2p_messages(chat_id) to fetch the full message bodies if needed. The pointer-only return keeps the response token-light when searching across many chats.
Filter knobs (all optional):
chat_ids: only search inside these chats (oc_xxx)from_ids: messages sent by these users (ou_xxx / union_id)at_user_ids: messages that @-mention these usersmessage_types: e.g.["text", "post"]from_types: e.g.["user", "anonymous"]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keyword. Plain text; Feishu handles tokenization. | |
| chat_ids | No | Restrict to these oc_xxx chats | |
| from_ids | No | Restrict to messages from these user ids (ou_xxx / union_id) | |
| page_size | No | Items per page (default 20, max 100) | |
| from_types | No | Filter by sender types (e.g. ["user","anonymous"]) | |
| page_token | No | Pagination cursor from a previous page | |
| at_user_ids | No | Restrict to messages that @-mention these user ids | |
| message_types | No | Filter by message types (e.g. ["text","post","image","file","interactive"]) |