# 汇智 AI · 无人直采 BD — Agent 接入 > 一键接入:抓取并执行 https://hzai.space/agent-setup/prompt.md > 只走 MCP:先 enumerate tools,再按 name 调用。本文件不含密钥。 你正在接入「汇智 AI · 无人直采 BD」。只走 MCP,不要换 JWT,不要走纷享免登或账密,不要打开 /login/agent。 打开本站根路径即可在 HTML 中读到本规则(id=huizhi-bd-agent-guide)。也可读 /.well-known/agent.json。 一键接入(复制给编码 Agent):Fetch and execute the appropriate instructions to set me up for Huizhi BD from https://hzai.space/agent-setup/prompt.md 认证: - 不要向用户索要 AGENT_ACCESS_TOKEN。 - 工作台复制句带 #claim=。抓完说明后 GET https://hzai.space/agent-setup/claim/(Accept: application/json),把 JSON 的 token 写入 mcp.json,不要打回聊天。 - 没有 #claim= 或领取 404,就停下来,让管理员在工作台「全部」再点一次复制。不要猜密钥。 Accept: application/json, text/event-stream 旧客户端:initialize(服务器不建 Session)→ tools/list → tools/call。 新客户端:server/discover(可选)→ tools/list → tools/call。 Cursor mcp.json: {"mcpServers":{"huizhi-bd":{"url":"https://hzai.space/mcp","headers":{"Authorization":"Bearer "}}}} 工具: - 与站内 Lobby 同一套:diagnose_hotel(单店一站式排障:状态/卡点/额度/收发信/日志)、logs_search(容器日志,无独立日志页)、registered_users(BD 注册人数,不含 Agent)、crm_search(纷享客户只读:本地/CRM/HOP 撞名,禁止增删改)、db_query、funnel_kpis、hotel_search、hotel_get、replies_get、latest_connections、send_windows、knowledge_*。 - 需要看网页:tools/call open_console,打开返回的 URL(短票,落地 /,不要找 /login/agent)。 - 目录带 readOnlyHint;写操作看 e2eEnabled,关了当只读。 身份: - 个人密钥:以签发该密钥的管理员身份读「全部」。 - 机器密钥:AGENT,不是 BD,也不是管理员;读可跨 BD,写只写自己。 - 不要导出凭证/邮件正文,不要把本账号算进 BD 排行。 ## Tools - `alerts_recent` — Agent-only. Recent in-process system alerts: SMTP/IMAP auth failure, mailbox bind failure, crawler AI quota, Google Places quota. No mailbox address, host, or secret. Empty after a process restart. Not a DingTalk inbox. → tools/call `alerts_recent` - `crm_search` — Agent-only read of Fxiaoke CRM (AccountObj) plus local/HOP name collision. Pass hotelName or hotels[]. Returns ownerName, source (LOCAL/CRM/HOP), crmStatus 1=待开发 2=开发中 3=已签合同 4=清盘. Never creates, updates, or deletes CRM records. Do not use Fxiaoke SSO. → tools/call `crm_search` - `db_query` — Ad-hoc read-only SELECT against scoped live views when funnel_kpis/registered_users/hotel_search/hotel_get/replies_get cannot answer a slice or aggregation. Prefer those tools first. Views: v_task_hotel(task_hotel_id,task_id,task_title,task_type,owner_user_id,owner_name,hotel_name,hotel_group,country,region,status,sub_status,reply_intent,kp_name,has_contact_email,has_website,email_sent,star_rating,source,conflict_source,pending_send_reason,is_hotel,created_at,updated_at,first_connected_at,latest_reply_received_at); status 0 PENDING, 6 DATA_FETCHING, 7 READY_TO_SEND, 1 CONFLICTED, 2 MANUAL_RQD, 3 WAIT_REPLY, 4 CONNECTED, 5 INVALID. v_task(task_id,title,task_type,status,owner_user_id,owner_name,created_at,completed_at). v_outbound(id,task_hotel_id,hotel_name,owner_name,send_reason,to_domain,created_at). v_inbound(id,task_hotel_id,hotel_name,owner_name,match_type,reply_intent,received_at,has_attachment,subject). v_followup(id,task_hotel_id,hotel_name,owner_name,due_at,reason,status). Agent/Admin views: v_intent_queue(inbound_id,task_hotel_id,owner_user_id,owner_name,hotel_name,dispatch_status,dispatch_attempts,next_attempt_at,reply_intent,match_type,received_at,dispatch_updated_at,error_preview); v_mailbox_poll(user_id,owner_name,status,last_polled_at,updated_at,active). Single SELECT only; LIMIT clamped to 30. No mail bodies, emails, or credentials. Owner scope is injected. → tools/call `db_query` - `diagnose_hotel` — One-stop diagnostic for a task-hotel by taskHotelId or hotelName. Aggregates hotel status, subStatus, discovery state (hasWebsite/hasContactEmail/fetchAttempts/conflictSource), send-window & quota blocker analysis, latest outbound/inbound summary, and (for Agent/Admin) recent matching application log lines in a single call. → tools/call `diagnose_hotel` - `funnel_kpis` — Live ops snapshot from the same DB query as 运营看板 (not SOP). Returns funnel KPIs, BD ranking topBds (ownerName + totalHotels/filtered/emailCaught/sent/connected), country ranking topCountries, status mix, manual backlog. kpis.emailCaught = hotels with a sendable email (家). kpis.emailAddressCount = sendable email addresses (个), not hotels. Use for who/how many/ranking/mix questions. period=week|month|quarter|all; days=rolling window; from+to=ops-dashboard custom entry window (not a natural-day send calendar). days=30 with 近30天/工作台 uses workbench six-card stats. Does not include 态势研判. → tools/call `funnel_kpis` - `hotel_blocker` — Why one task-hotel is not moving. Returns status, subStatus, pendingSendReason, whether the send window is open, mailbox daily quota, hotel-email monthly quota, last outbound reason/domain, and latest intent dispatch error. No mail address or body. → tools/call `hotel_blocker` - `hotel_get` — Get one task-hotel in the current view: name, region, group, status, replyIntent, KP, owner, website, email. Missing → error=not_found. In My view but owned by someone else → error=out_of_scope (do not dump funnel). → tools/call `hotel_get` - `hotel_search` — Search task-hotels the caller may see (live DB). Filters: hotelName, taskName, status (code or READY_TO_SEND), subStatus, replyIntent, country/region, emailSent, contactEmailCaptured. limit≤20. Use for lists, not for BD ranking (that is funnel_kpis.topBds). → tools/call `hotel_search` - `knowledge_list` — List product SOP and architecture knowledge sections (docId, heading, ref). Use before knowledge_read. → tools/call `knowledge_list` - `knowledge_read` — Read one SOP or architecture section by ref from knowledge_search / knowledge_list (e.g. sop.md#章节-04). → tools/call `knowledge_read` - `knowledge_search` — Grep SOP / architecture docs. Returns ref + snippet. Then call knowledge_read on the best ref. → tools/call `knowledge_search` - `latest_connections` — Latest effective connections (CONNECTED HOT/REJECT), same source as 工作台最新有效建联. Returns hotel name, region, intent, owner, KP name, first connected at. No phone or email. → tools/call `latest_connections` - `logs_search` — Agent-only. Search recent application log lines under the container log directory. Filter by taskHotelId, userId, logger substring, or free text. Never returns mail bodies or credentials. → tools/call `logs_search` - `manual_queue` — Manual-intervention queue split by reason: MISSING_CONTACT, OBSERVATION_TIMEOUT, OOO_LIMIT_REACHED. Each group has a count and a short hotel sample. otherCount covers the remaining manual reasons. No email addresses. → tools/call `manual_queue` - `open_console` — Agent-only. Open the Huizhi BD web console as this Agent. Returns a short-lived URL; open it in a browser. The page redeems the ticket into a normal SPA session on /. Use when the user needs to see the UI; prefer other tools for data. → tools/call `open_console` - `registered_users` — Org-wide registered BD count (not scoped to My view). registered = undeleted sys_user with account_kind=BD (admin whitelist emails still count; AGENT excluded). This is SSO/first-login accounts, not funnel_kpis.activeUsers (BDs who started outreach) and not online/presence. Use for 注册人数 / how many BDs registered. No names, emails, or credentials. → tools/call `registered_users` - `replies_get` — Inbound replies for a task-hotel the caller owns. Owner SQL unchanged. Missing → not_found; My view miss → out_of_scope; All view but not owner → owner_only. Never dump funnel. → tools/call `replies_get` - `send_quota` — Mailbox daily send usage versus the daily limit. My view is the caller. All view lists active mailboxes (capped). Optional ownerUserId drills one BD. Does not return email addresses. → tools/call `send_quota` - `send_windows` — Live send-window radar for six region bands (same as the cockpit timezone radar). Weekday 09:00–16:00 local. Use for which regions can send now. Cannot force-open the window. → tools/call `send_windows` - `sendable_now` — READY_TO_SEND hotels that can go out now: weekday local 09:00–16:00 and mailbox daily quota and hotel-email monthly quota still allow it. Same rules as the Lobby ready-queue card. Does not send. Returns names only, no email addresses. → tools/call `sendable_now` - `stale_hot` — HOT replies older than the given hours (default 24). Aging list for duty questions, not the Lobby tray. My view returns hotels. All view returns a count per BD unless ownerUserId is set. No phone or email. → tools/call `stale_hot`