Skip to main content
Glama

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 users

  • message_types: e.g. ["text", "post"]

  • from_types: e.g. ["user", "anonymous"]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keyword. Plain text; Feishu handles tokenization.
chat_idsNoRestrict to these oc_xxx chats
from_idsNoRestrict to messages from these user ids (ou_xxx / union_id)
page_sizeNoItems per page (default 20, max 100)
from_typesNoFilter by sender types (e.g. ["user","anonymous"])
page_tokenNoPagination cursor from a previous page
at_user_idsNoRestrict to messages that @-mention these user ids
message_typesNoFilter by message types (e.g. ["text","post","image","file","interactive"])
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses the wrapped API endpoint, auth requirements, a specific error condition, and the pointer-only return shape with pagination fields. It does not mention rate limits, but for a read-only search that is less critical, and the provided details are substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: it opens with the core purpose, then covers requirements, return format, and filter knobs. While not terse, each section earns its place and the information is front-loaded and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters, no output schema, and no annotations, the description is remarkably complete. It covers prerequisites, error cases, return structure (items, pageToken, hasMore), pointer semantics, and how to follow up with read_messages. This is sufficient for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description lists filter knobs with examples (e.g., oc_xxx, ou_xxx) that largely mirror the schema descriptions, adding little new semantics beyond grouping. The additional return-value explanation is not directly parameter-related.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Search the user's IM history by keyword', a clear verb+resource statement that distinguishes this tool from sibling search tools like search_contacts, search_docs, and search_wiki. It also explicitly notes the bot-path limitation, reinforcing its specific purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear prerequisites (UAT with search:message scope) and an exclusion ('if you only have app credentials this tool will error'), and directs users to read_messages/read_p2p_messages for full message bodies. While it doesn't explicitly compare against sibling search tools, the context is sufficient for correct selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EthanQC/feishu-user-plugin'

If you have feedback or need assistance with the MCP directory API, please join our Discord server