Skip to main content
Glama

知你AI助手|多平台客户与客服数据 MCP

搜索客户

zhini_search_customers

搜索客户通讯录,用于根据客户名、手机号、微信号、客服、负责人、明确标签、渠道、性别、联系人类型或时间范围完整召回符合条件的客户 UID。用户只要求查询当天或某个时间范围内咨询过的客户时,默认查询当前授权账号关联的所有渠道范围,不代表当前调用客服本人接待或回复过;除非用户明确说“我处理过、我接待过、我回复过、归属于我”或指定某客服/渠道,否则不要自动传 kfid、pic_kfids 或 channel_id。用户要求查询某天或某段时间内的全部用户、包括会话已经结束/关闭的用户时,应使用本工具分页查询,不能用 zhini_list_active_sessions 代替。重要边界:自然语言中的“XXX 用户/客户”默认是业务语义或筛选条件,不应自动转换为 tag_id。可由名称、时间、渠道、客服等结构化字段表达的条件直接使用本工具;必须根据聊天内容判断的条件,应结合 zhini_search_sessions 和 zhini_fetch_messages 识别。只有用户明确要求某标签或上下文已有 tag_id 时才按标签筛选,且 tag_id 只覆盖已标注客户。用户给客户姓名/手机号/微信号时先用本工具召回候选客户;如果匹配多个客户,应让用户确认。用户明确给出标签名、渠道名、客服名时,应先分别调用 zhini_search_tags、zhini_list_channels、zhini_list_kefu 解析 ID。禁止空条件拉全量;page 从 0 开始;page_size 最大 20。后续:拿到 uid 后通常调用 zhini_get_customer_profile 或 zhini_fetch_messages。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sexNo性别枚举数组:0 未知,1 男,2 女。
kfidNo归属员工/客服 ID 列表。用户给客服名时应先调用 zhini_list_kefu 解析 kfid。
nameNo客户昵称或名称关键词。
pageNo页码,从 0 开始。
phoneNo手机号关键词。
tag_idNo标签 ID 列表。用户给标签名时应先调用 zhini_search_tags 解析 tag_id。
page_sizeNo每页返回客户数量,默认 20,最大 20。
pic_kfidsNo负责人 ID 列表。用户给负责人姓名时应先调用 zhini_list_kefu 解析 kfid。
channel_idNo渠道 ID 列表。用户给渠道名时应先调用 zhini_list_channels 解析 channel_id。
user_wechat_idNo微信号关键词。
add_friend_timeNo添加好友时间范围,秒级 Unix 时间戳二元组;[0,0] 表示无添加时间。
wx_contact_typeNo联系人类型数组:0 联系人,1 群组。
last_contact_timeNo最后联系时间范围,秒级 Unix 时间戳二元组;[0,0] 表示无最后联系时间。

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full disclosure burden, and it does so well. It discloses the default query scope (authorized account's channels rather than the current kefu's own), the boundary that tag_id only covers labeled customers, the prohibition on empty-condition full pulls, pagination constraints (page from 0, page_size max 20), and that the return is customer UIDs for downstream calls. It loses one point only for not describing the response shape or error behavior, which for a no-annotation tool could have been richer.

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 long but every sentence carries decision-relevant information—no filler or tautology. It is front-loaded with purpose and default-scope behavior before the routing rules. The length is justified by the tool's complexity (13 parameters, many boundary conditions, multiple sibling relationships). It loses one point because the density could have been organized into clearer sections, but there is no wasted prose.

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 13-parameter tool with no annotations and no output schema, the description is remarkably complete. It covers core purpose, sibling routing (zhini_list_active_sessions, zhini_search_sessions + zhini_fetch_messages), default-scope semantics, ID-resolution prerequisites, natural-language tag boundaries, pagination constraints, and the downstream workflow (zhini_get_customer_profile or zhini_fetch_messages after obtaining UIDs). The return value (customer UIDs) is stated in the first sentence, compensating for the missing output schema.

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?

Schema description coverage is 100%, so the baseline is 3. The description goes beyond the schema by adding contextual usage semantics: it explicitly warns not to pass kfid/pic_kfids/channel_id unless the user states personal involvement or specifies a kefu/channel, and it documents the ID-resolution dependency (call zhini_search_tags/zhini_list_channels/zhini_list_kefu first) that the schema only hints at. This adds decision-relevant meaning the schema alone does not convey.

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 a precise verb+resource statement: 搜索客户通讯录 (search customer address book) and enumerates every searchable criterion (name, phone, WeChat ID, kefu, responsible person, tag, channel, gender, contact type, time range) plus the output (customer UIDs). It actively distinguishes itself from siblings, explicitly stating it cannot be replaced by zhini_list_active_sessions for time-range all-user queries, so an agent can select it correctly.

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?

Exceptional when/when-not guidance. It specifies default scope behavior (all channels of the authorized account, not just the current kefu's handled customers), the exact conditions under which kfid/pic_kfids/channel_id should NOT be auto-passed, the natural-language tag boundary (don't auto-convert 用户/客户 to tag_id), routing to zhini_search_sessions + zhini_fetch_messages for chat-content conditions, ID-resolution prerequisites (zhini_search_tags, zhini_list_channels, zhini_list_kefu), multi-match confirmation, and pagination limits. This leaves no ambiguity about when to invoke it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.