{"version":"11","kind":"huizhi-bd-agent","humanLoginPath":"/","mePath":"/api/v1/auth/me","instructionsPath":"/llms.txt","wellKnownPath":"/.well-known/agent.json","doNotUse":["/api/v1/auth/login","/api/v1/auth/sso/fxiaoke","/api/v1/auth/agent/session","/api/v1/bd/agent/tools","/login/agent"],"prompt":"你正在接入「汇智 AI · 无人直采 BD」。只走 MCP，不要换 JWT，不要走纷享免登或账密，不要打开 /login/agent。\n打开本站根路径即可在 HTML 中读到本规则（id=huizhi-bd-agent-guide）。也可读 /.well-known/agent.json。\n一键接入（复制给编码 Agent）：Fetch and execute the appropriate instructions to set me up for Huizhi BD from https://hzai.space/agent-setup/prompt.md\n\n认证：\n- 不要向用户索要 AGENT_ACCESS_TOKEN。\n- 工作台复制句带 #claim=<ticket>。抓完说明后 GET https://hzai.space/agent-setup/claim/<ticket>（Accept: application/json），把 JSON 的 token 写入 mcp.json，不要打回聊天。\n- 没有 #claim= 或领取 404，就停下来，让管理员在工作台「全部」再点一次复制。不要猜密钥。\n  Accept: application/json, text/event-stream\n  旧客户端：initialize（服务器不建 Session）→ tools/list → tools/call。\n  新客户端：server/discover（可选）→ tools/list → tools/call。\n  Cursor mcp.json: {\"mcpServers\":{\"huizhi-bd\":{\"url\":\"https://hzai.space/mcp\",\"headers\":{\"Authorization\":\"Bearer <MCP_BEARER>\"}}}}\n\n工具：\n- 与站内 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_*。\n- 需要看网页：tools/call open_console，打开返回的 URL（短票，落地 /，不要找 /login/agent）。\n- 目录带 readOnlyHint；写操作看 e2eEnabled，关了当只读。\n\n身份：\n- 个人密钥：以签发该密钥的管理员身份读「全部」。\n- 机器密钥：AGENT，不是 BD，也不是管理员；读可跨 BD，写只写自己。\n- 不要导出凭证/邮件正文，不要把本账号算进 BD 排行。","sessionPromptId":"huizhi-bd-agent-session","sessionPrompt":"你通过 MCP 接入汇智无人直采 BD。initialize 或 server/discover 看能力；tools/list 再 tools/call。不要走纷享免登，不要换 JWT，不要打开 /login/agent。查纷享用 crm_search（只读），不要创建或更新客户。\n需要看网页时 tools/call open_console，打开返回的 URL。不要在导航栏找「日志」。\ne2eEnabled 看网页会话 /auth/me 或写操作是否 403。false 视为只读。\nlogs_search 是查容器日志的唯一工具（query / taskHotelId / userId / logger）。","toolInvokeMethod":"tools/call","toolInvokePath":"/mcp","tools":[{"name":"alerts_recent","description":"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.","kind":"query","agentOnly":true,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"limit":{"description":"Max alerts, default 20, cap 40","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"crm_search","description":"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.","kind":"query","agentOnly":true,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"hotelName":{"description":"Single hotel name","type":"string"},"hotels":{"type":"array","items":{"type":"string"},"description":"Hotel names to look up, max 20"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":true}},{"name":"db_query","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"sql":{"description":"One SELECT against the views above. Example: SELECT country, COUNT(*) AS n FROM v_task_hotel WHERE status = 2 GROUP BY country ORDER BY n DESC","type":"string"}},"required":["sql"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"diagnose_hotel","description":"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.","kind":"lookup","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"taskHotelId":{"description":"Optional bd_task_hotel.id","type":"integer"},"hotelName":{"description":"Optional hotel name keyword when taskHotelId is unknown","type":"string"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"funnel_kpis","description":"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 态势研判.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"period":{"description":"week / month / quarter / all. week=current ISO week in Asia/Shanghai.","type":"string"},"days":{"description":"Rolling last N days when period is all/omitted. Use 14 for 近两周, 30 for 工作台近30天.","type":"integer"},"from":{"description":"YYYY-MM-DD inclusive custom range; must pair with to. Ops-dashboard entry window.","type":"string"},"to":{"description":"YYYY-MM-DD inclusive custom range; must pair with from.","type":"string"},"country":{"description":"Optional country/region substring to filter geo rows","type":"string"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"hotel_blocker","description":"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.","kind":"lookup","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"taskHotelId":{"description":"bd_task_hotel.id","type":"integer"}},"required":["taskHotelId"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"hotel_get","description":"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).","kind":"lookup","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"taskHotelId":{"description":"bd_task_hotel.id","type":"integer"}},"required":["taskHotelId"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"hotel_search","description":"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).","kind":"lookup","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"hotelName":{"description":"Hotel name keyword","type":"string"},"taskName":{"description":"Task title keyword","type":"string"},"status":{"description":"Status code or enum name, e.g. 7 or READY_TO_SEND","type":"string"},"subStatus":{"description":"sub_status such as MISSING_CONTACT","type":"string"},"replyIntent":{"description":"HOT / REJECT / BOUNCE / OOO","type":"string"},"country":{"description":"Region / country keyword","type":"string"},"emailSent":{"description":"true=already sent outreach; false=not sent","type":"boolean"},"contactEmailCaptured":{"description":"true=has sendable email; false=missing email","type":"boolean"},"limit":{"description":"Max rows, default 10, max 20","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"knowledge_list","description":"List product SOP and architecture knowledge sections (docId, heading, ref). Use before knowledge_read.","kind":"retrieve","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"docId":{"description":"Optional: sop.md or architecture.md","type":"string"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"knowledge_read","description":"Read one SOP or architecture section by ref from knowledge_search / knowledge_list (e.g. sop.md#章节-04).","kind":"retrieve","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"ref":{"description":"Section ref such as architecture.md#核心业务场景-系统功能意图路由矩阵","type":"string"}},"required":["ref"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"knowledge_search","description":"Grep SOP / architecture docs. Returns ref + snippet. Then call knowledge_read on the best ref.","kind":"retrieve","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"query":{"description":"Keywords to search, e.g. 区域距离搜索 or mailbox bind","type":"string"},"limit":{"description":"Max hits, default 8","type":"integer"},"bias":{"description":"definition | howto | none","type":"string"}},"required":["query"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"latest_connections","description":"Latest effective connections (CONNECTED HOT/REJECT), same source as 工作台最新有效建联. Returns hotel name, region, intent, owner, KP name, first connected at. No phone or email.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"limit":{"description":"Max rows, default 8, max 8","type":"integer"},"period":{"description":"week / month / quarter / all","type":"string"},"from":{"description":"YYYY-MM-DD inclusive, must pair with to","type":"string"},"to":{"description":"YYYY-MM-DD inclusive, must pair with from","type":"string"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"logs_search","description":"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.","kind":"query","agentOnly":true,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"query":{"description":"Optional substring (hotel name, exception class, IMAP, SMTP)","type":"string"},"taskHotelId":{"description":"Optional bd_task_hotel.id to match in the line","type":"integer"},"userId":{"description":"Optional sys_user.id to match in the line","type":"integer"},"logger":{"description":"Optional logger simple name, e.g. MailIngestService","type":"string"},"limit":{"description":"Max lines to return, default 40, cap 80","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"manual_queue","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"ownerUserId":{"description":"Optional sys_user.id. All view only.","type":"integer"},"limit":{"description":"Sample size per reason, default 8, max 20","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"open_console","description":"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.","kind":"tool","agentOnly":true,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},{"name":"registered_users","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"replies_get","description":"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.","kind":"mail","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"taskHotelId":{"description":"bd_task_hotel.id","type":"integer"}},"required":["taskHotelId"]},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"send_quota","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"ownerUserId":{"description":"Optional sys_user.id. Ignored when the current view is My.","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"send_windows","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"sendable_now","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"ownerUserId":{"description":"Optional sys_user.id. All view only.","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}},{"name":"stale_hot","description":"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.","kind":"query","agentOnly":false,"invokeMethod":"tools/call","invokePath":"/mcp","parameters":{"type":"object","properties":{"ownerUserId":{"description":"Optional sys_user.id. All view: list that BD's hotels.","type":"integer"},"hours":{"description":"Age threshold in hours, default 24, max 168","type":"integer"},"limit":{"description":"Max rows, default 8, max 20","type":"integer"}}},"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"annotations":{"readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false}}],"icons":[{"src":"https://hzai.space/lobby-mark.png","mimeType":"image/png"}],"mcpPath":"/mcp","mcpUrl":"https://hzai.space/mcp","mcpTransport":"streamable-http","setupPath":"/agent-setup/prompt.md","setupUrl":"https://hzai.space/agent-setup/prompt.md","setupPrompt":"Fetch and execute the appropriate instructions to set me up for Huizhi BD from https://hzai.space/agent-setup/prompt.md"}