Skip to main content
Glama

feishu_im_user_search_messages

Search Feishu messages across conversations by keywords, sender, mentions, message type, or time range to find specific information within chat history.

Instructions

【以用户身份】跨会话搜索飞书消息。

用法:

  • 按关键词搜索消息内容

  • 按发送者、被@用户、消息类型过滤

  • 按时间范围过滤:relative_time 或 start_time/end_time

  • 限定在某个会话内搜索(chat_id)

  • 支持分页:page_size + page_token

【参数约束】

  • 所有参数均可选,但至少应提供一个过滤条件

  • relative_time 和 start_time/end_time 不能同时使用

  • page_size 范围 1-50,默认 50

返回消息列表,每条消息包含 message_id、msg_type、content、sender、create_time 等字段。 每条消息还包含 chat_id、chat_type(p2p/group)、chat_name(群名或单聊对方名字)。 单聊消息额外包含 chat_partner(对方 open_id 和名字)。 搜索结果中的 chat_id 和 thread_id 可配合 feishu_im_user_get_messages / feishu_im_user_get_thread_messages 查看上下文。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo搜索关键词,匹配消息内容。可为空字符串表示不按内容过滤
sender_idsNo发送者 open_id 列表。如需根据用户名查找 open_id,请先使用 search_user 工具
chat_idNo限定搜索范围的会话 ID(oc_xxx)
mention_idsNo被@用户的 open_id 列表
message_typeNo消息类型过滤:file / image / media。为空则搜索所有类型
sender_typeNo发送者类型:user / bot / all。默认 user
chat_typeNo会话类型:group(群聊)/ p2p(单聊)
relative_timeNo相对时间范围:today / yesterday / day_before_yesterday / this_week / last_week / this_month / last_month / last_{N}_{unit}(unit: minutes/hours/days)。与 start_time/end_time 互斥
start_timeNo起始时间(ISO 8601 格式,如 2026-02-27T00:00:00+08:00)。与 relative_time 互斥
end_timeNo结束时间(ISO 8601 格式,如 2026-02-27T23:59:59+08:00)。与 relative_time 互斥
page_sizeNo每页消息数(1-50),默认 50
page_tokenNo分页标记,用于获取下一页
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so comprehensively. It describes the search scope ('跨会话'), filtering capabilities, pagination behavior, return format details (including specific fields like message_id, msg_type, content, sender, create_time, chat metadata), and how results relate to other tools. It also specifies important constraints like '所有参数均可选,但至少应提供一个过滤条件' (all parameters optional but at least one filter required) and page_size limits.

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

Conciseness5/5

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

The description is well-structured with clear sections (purpose, usage, constraints, return values) and every sentence earns its place. It's appropriately sized for a complex 12-parameter search tool, providing necessary detail without redundancy. The information is front-loaded with the core purpose, followed by practical usage guidance, then technical constraints.

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?

For a complex search tool with 12 parameters and no annotations or output schema, the description provides complete context. It covers the tool's purpose, detailed usage scenarios, parameter constraints, return format (including specific field names and chat metadata), pagination behavior, and integration with sibling tools. The description fully compensates for the lack of structured metadata.

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

Parameters4/5

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

The schema has 100% description coverage, so the baseline is 3. The description adds significant value beyond the schema by explaining parameter relationships and constraints in the '【参数约束】' section, such as the requirement for at least one filter, mutual exclusivity between time filters, and page_size defaults/ranges. It also provides context about how parameters work together in the '用法' section. However, it doesn't fully explain complex parameter interactions beyond the basic constraints.

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 explicitly states the tool's purpose as '跨会话搜索飞书消息' (search Feishu messages across sessions) with the user identity context. It clearly distinguishes this search functionality from sibling tools like feishu_im_user_get_messages (which retrieves messages from a specific chat) and feishu_search_user (which searches for users). The verb '搜索' (search) combined with the resource '飞书消息' (Feishu messages) provides specific, unambiguous purpose.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance in the '用法' section, detailing multiple filtering capabilities (keyword, sender, mentions, message type, time range, chat scope). It also specifies when to use this tool versus alternatives by stating that results can be used '配合 feishu_im_user_get_messages / feishu_im_user_get_thread_messages 查看上下文' (with those tools to view context). The parameter constraints section further clarifies usage rules like mutual exclusivity between time filters.

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/WilliamMo101/lark-hermes-mcp'

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